Skip to content

Commit

Permalink
Revert "feat(impl): [#519] add test step definitions"
Browse files Browse the repository at this point in the history
This reverts commit d71eb65.
  • Loading branch information
ds-jhartmann committed May 13, 2024
1 parent 5d55d38 commit 81609a7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, ArrayList<LinkedHashMap<String, ?>>> fetchPoliciesForBpn(
final AuthenticationPropertiesBuilder authenticationPropertiesBuilder, final String bpn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 81609a7

Please sign in to comment.