From 4db48e93b753f795fbb455405f06d2e8ce279db0 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Fri, 10 May 2024 14:34:45 +0200 Subject: [PATCH] feat(impl): [#528] add step definition for cucumber tests for validating error response message --- .../cucumber/E2ETestStepDefinitionsForPolicyStoreApi.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForPolicyStoreApi.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForPolicyStoreApi.java index a775f3c0b0..884d5199cb 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForPolicyStoreApi.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestStepDefinitionsForPolicyStoreApi.java @@ -314,6 +314,11 @@ public void theCreatePolicyResponseShouldHaveStatus(final int httpStatus) { this.createPoliciesResponse.statusCode(httpStatus); } + @Then("the create policy response should have message containing {string}") + public void theCreatePolicyResponseShouldHaveMessageContaining(final String string) { + this.createPoliciesResponse.body("messages", Matchers.hasItem(Matchers.containsString(string))); + } + @Then("the update policy response should have HTTP status {int}") public void theUpdatePolicyResponseShouldHaveStatus(final int httpStatus) { this.updatePoliciesResponse.statusCode(httpStatus);