diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java index be329a9e02..470f714830 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java @@ -42,7 +42,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; -import jakarta.validation.constraints.Pattern; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; @@ -218,16 +217,6 @@ public void deleteAllowedPolicy(@PathVariable("policyId") final String policyId) service.deletePolicy(policyId); } - @DeleteMapping("/policies/{policyId}/bpnl/{bpnl}") - @ResponseStatus(HttpStatus.OK) - @PreAuthorize("hasAuthority('" + IrsRoles.ADMIN_IRS + "')") - public void removeAllowedPolicyFromBpnl( - @PathVariable("policyId") final String policyId, // - @Pattern(regexp = BPN_REGEX, message = " Invalid BPN.") // - @PathVariable("bpnl") final String bpnl) { - service.deletePolicyForEachBpn(policyId, List.of(bpnl)); - } - @Operation(operationId = "updateAllowedPolicy", summary = "Updates existing policies.", security = @SecurityRequirement(name = "api_key"), tags = { "Item Relationship Service" }, description = "Updates existing policies.") diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java index 8f6f83afb0..a47ba48ea5 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java @@ -218,7 +218,7 @@ public void deletePolicy(final String policyId) { } } - public void deletePolicyForEachBpn(final String policyId, final List bpnList) { + private void deletePolicyForEachBpn(final String policyId, final List bpnList) { try { for (final String bpn : bpnList) { persistence.delete(bpn, policyId); diff --git a/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java b/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java index ac47fd0b4d..802a60114c 100644 --- a/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java +++ b/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.UUID; import jakarta.json.Json; import jakarta.json.JsonObject; @@ -356,17 +355,6 @@ private Constraints createConstraints() { @Nested class DeletePolicyTests { - @Test - void deletePolicyForEachBpn_success() { - // ACT - final String policyId = UUID.randomUUID().toString(); - testee.deletePolicyForEachBpn(policyId, List.of("BPN1", "BPN2")); - - // ASSERT - verify(persistenceMock).delete("BPN1", policyId); - verify(persistenceMock).delete("BPN2", policyId); - } - @Test void deletePolicy_deleteSuccessful() { // ARRANGE