From 81609a74ed36d260a6fa63d7aba910c2fc61d910 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Mon, 13 May 2024 18:12:35 +0200 Subject: [PATCH] Revert "feat(impl): [#519] add test step definitions" This reverts commit d71eb656579853d85f5da7dbb481b762cd077913. --- .../E2ETestHelperForPolicyStoreApi.java | 8 ---- ...ETestStepDefinitionsForPolicyStoreApi.java | 39 ------------------- ...y-for-e2e-tests-with-empty-definition.json | 8 ---- ...licy-for-e2e-tests-without-definition.json | 6 --- 4 files changed, 61 deletions(-) delete mode 100644 irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-with-empty-definition.json delete mode 100644 irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-without-definition.json diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java index c3793d8dac..f7d7eec12d 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java @@ -62,14 +62,6 @@ public static String getPolicyTemplate() throws IOException { return E2ETestHelper.getTemplateFileContent("policy-for-e2e-tests.json"); } - public static String getPolicyTemplateWithoutDefinition() throws IOException { - return E2ETestHelper.getTemplateFileContent("policy-for-e2e-tests-without-definition.json"); - } - - public static String getPolicyTemplateWithEmptyDefinition() throws IOException { - return E2ETestHelper.getTemplateFileContent("policy-for-e2e-tests-with-empty-definition.json"); - } - @SuppressWarnings("unchecked") public static Map>> fetchPoliciesForBpn( final AuthenticationPropertiesBuilder authenticationPropertiesBuilder, final String bpn) { 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 ca0e3a2902..6e2053d7c5 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 @@ -30,8 +30,6 @@ import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.fetchPoliciesForBusinessPartnerNumbers; import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.getExpectedBpnToPolicyIdsMapping; import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.getPolicyTemplate; -import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.getPolicyTemplateWithEmptyDefinition; -import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.getPolicyTemplateWithoutDefinition; import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.registerPolicyForBpn; import static org.eclipse.tractusx.irs.cucumber.E2ETestHelperForPolicyStoreApi.updatePolicies; @@ -241,22 +239,6 @@ public void iRegisterAPolicy(final String policyId, final String bpn, final Stri validUntil); } - @When("a policy with policyId {string} WITHOUT definition is registered for BPN {string} and validUntil {string}") - public void iRegisterAPolicyWithoutDefinition(final String policyId, final String bpn, final String validUntil) - throws IOException { - final String policyJson = getPolicyTemplateWithoutDefinition().formatted(policyId); - this.createPoliciesResponse = registerPolicyForBpn(this.authenticationPropertiesBuilder, policyJson, bpn, - validUntil); - } - - @When("a policy with policyId {string} WITH EMPTY definition is registered for BPN {string} and validUntil {string}") - public void iRegisterAPolicyWithEmptyDefinition(final String policyId, final String bpn, final String validUntil) - throws IOException { - final String policyJson = getPolicyTemplateWithEmptyDefinition().formatted(policyId); - this.createPoliciesResponse = registerPolicyForBpn(this.authenticationPropertiesBuilder, policyJson, bpn, - validUntil); - } - @When("a policy WITHOUT payload is registered for BPN {string} and validUntil {string}") public void iRegisterAPolicyWithoutPayload(final String bpn, final String validUntil) { this.createPoliciesResponse = registerPolicyForBpn(this.authenticationPropertiesBuilder, null, bpn, validUntil); @@ -343,27 +325,6 @@ 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) { - final ValidatableResponse validatableResponse = this.createPoliciesResponse; - assertThatResponseHasMessageContaining(validatableResponse, string); - } - - @Then("the delete policy response should have message containing {string}") - public void thedeletePolicyResponseShouldHaveMessageContaining(final String string) { - assertThatResponseHasMessageContaining(this.deletePoliciesResponse, string); - } - - @Then("the update policy response should have message containing {string}") - public void theUpdatePolicyResponseShouldHaveMessageContaining(final String string) { - assertThatResponseHasMessageContaining(this.updatePoliciesResponse, string); - } - - private static void assertThatResponseHasMessageContaining(final ValidatableResponse validatableResponse, - final String string) { - validatableResponse.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); diff --git a/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-with-empty-definition.json b/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-with-empty-definition.json deleted file mode 100644 index 9b77780cb8..0000000000 --- a/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-with-empty-definition.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@context": { - "odrl": "http://www.w3.org/ns/odrl/2/" - }, - "@id": "%s", - "policy": { - } -} \ No newline at end of file diff --git a/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-without-definition.json b/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-without-definition.json deleted file mode 100644 index a7b356c030..0000000000 --- a/irs-cucumber-tests/src/test/resources/templates/policy-for-e2e-tests-without-definition.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "@context": { - "odrl": "http://www.w3.org/ns/odrl/2/" - }, - "@id": "%s" -} \ No newline at end of file