Skip to content

Commit

Permalink
Revert "feat(impl): [#559] add delete policy endpoint for single BPNL"
Browse files Browse the repository at this point in the history
This reverts commit 5280532
  • Loading branch information
ds-jhartmann committed May 13, 2024
1 parent fd40d73 commit d952b06
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void deletePolicy(final String policyId) {
}
}

public void deletePolicyForEachBpn(final String policyId, final List<String> bpnList) {
private void deletePolicyForEachBpn(final String policyId, final List<String> bpnList) {
try {
for (final String bpn : bpnList) {
persistence.delete(bpn, policyId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d952b06

Please sign in to comment.