diff --git a/src/functionalTest/java/uk/gov/hmcts/opal/steps/DefendantAccountDetailsStefDef.java b/src/functionalTest/java/uk/gov/hmcts/opal/steps/DefendantAccountDetailsStefDef.java index 5964cb839..f019ef999 100644 --- a/src/functionalTest/java/uk/gov/hmcts/opal/steps/DefendantAccountDetailsStefDef.java +++ b/src/functionalTest/java/uk/gov/hmcts/opal/steps/DefendantAccountDetailsStefDef.java @@ -23,7 +23,7 @@ public void getDefendantAccountDetailsByID(DataTable id) { .header("Authorization", "Bearer " + getToken()) .contentType("application/json") .when() - .get(getTestUrl() + "/api/defendant-account/details?defendantAccountId=" + idToSend.get("defendantID")); + .get(getTestUrl() + "/api/defendant-account/" + idToSend.get("defendantID")); } @When("I make an unauthenticated request to the defendant account details api with") @@ -33,7 +33,7 @@ public void getDefendantAccountDetailsByIDUnauthenticated(DataTable id) { .accept("*/*") .contentType("application/json") .when() - .get(getTestUrl() + "/api/defendant-account/details?defendantAccountId=" + idToSend.get("defendantID")); + .get(getTestUrl() + "/api/defendant-account/" + idToSend.get("defendantID")); } @When("I make a request to the defendant account details api with an invalid token") @@ -44,7 +44,7 @@ public void getDefendantAccountDetailsByIDInvalidToken(DataTable id) { .header("Authorization", "Bearer invalidToken") .contentType("application/json") .when() - .get(getTestUrl() + "/api/defendant-account/details?defendantAccountId=" + idToSend.get("defendantID")); + .get(getTestUrl() + "/api/defendant-account/" + idToSend.get("defendantID")); } @Then("the response from the defendant account details api is") diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/AccountTransferController.java b/src/main/java/uk/gov/hmcts/opal/controllers/AccountTransferController.java index cd718f411..c02ecea76 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/AccountTransferController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/AccountTransferController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/accountTransfers") +@RequestMapping("/api/account-transfer") @Slf4j(topic = "AccountTransferController") @Tag(name = "AccountTransfer Controller") public class AccountTransferController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/BusinessUnitController.java b/src/main/java/uk/gov/hmcts/opal/controllers/BusinessUnitController.java index 288a40c7a..96c85b813 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/BusinessUnitController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/BusinessUnitController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/businessUnits") +@RequestMapping("/api/business-unit") @Slf4j(topic = "BusinessUnitController") @Tag(name = "BusinessUnit Controller") public class BusinessUnitController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/CommittalWarrantProgressController.java b/src/main/java/uk/gov/hmcts/opal/controllers/CommittalWarrantProgressController.java index 851eb011d..e674b02c0 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/CommittalWarrantProgressController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/CommittalWarrantProgressController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/committalWarrantProgress") +@RequestMapping("/api/committal-warrant-progress") @Slf4j(topic = "CommittalWarrantProgressController") @Tag(name = "CommittalWarrantProgress Controller") public class CommittalWarrantProgressController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/CourtController.java b/src/main/java/uk/gov/hmcts/opal/controllers/CourtController.java index 209f675cf..ce6b0eaab 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/CourtController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/CourtController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/courts") +@RequestMapping("/api/court") @Slf4j(topic = "CourtController") @Tag(name = "Court Controller") public class CourtController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/DebtorDetailController.java b/src/main/java/uk/gov/hmcts/opal/controllers/DebtorDetailController.java index b52020102..509de0901 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/DebtorDetailController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/DebtorDetailController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/debtorDetails") +@RequestMapping("/api/debtor-detail") @Slf4j(topic = "DebtorDetailController") @Tag(name = "DebtorDetail Controller") public class DebtorDetailController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/DefendantAccountController.java b/src/main/java/uk/gov/hmcts/opal/controllers/DefendantAccountController.java index 113425a6a..46a7dbbbe 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/DefendantAccountController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/DefendantAccountController.java @@ -82,22 +82,9 @@ public ResponseEntity putDefendantAccount( return ResponseEntity.ok(response); } - @GetMapping(value = "/{businessUnit}") - @Operation(summary = "Returns all defendant accounts within a business unit") - public ResponseEntity> getDefendantAccountsByBusinessUnit( - @PathVariable short businessUnit) { - - log.info(":GET:getDefendantAccountsByBusinessUnit: busUnit: {}", businessUnit); - List response = defendantAccountService - .getDefendantAccountsByBusinessUnit(businessUnit); - - return buildResponse(response); - } - - @GetMapping(value = "/details") + @GetMapping(value = "/{defendantAccountId}") @Operation(summary = "Get defendant account details by providing the defendant account summary") - public ResponseEntity getAccountDetailsByAccountSummary( - @RequestParam(name = "defendantAccountId") Long defendantAccountId) { + public ResponseEntity getAccountDetailsByAccountSummary(@PathVariable Long defendantAccountId) { AccountDetailsDto response = defendantAccountService.getAccountDetailsByDefendantAccountId(defendantAccountId); diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/DocumentController.java b/src/main/java/uk/gov/hmcts/opal/controllers/DocumentController.java index 3da9e7543..6a93022bf 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/DocumentController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/DocumentController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/documents") +@RequestMapping("/api/document") @Slf4j(topic = "DocumentController") @Tag(name = "Document Controller") public class DocumentController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/DocumentInstanceController.java b/src/main/java/uk/gov/hmcts/opal/controllers/DocumentInstanceController.java index 13ef4fb0e..22ff0aa5e 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/DocumentInstanceController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/DocumentInstanceController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/documentInstances") +@RequestMapping("/api/document-instance") @Slf4j(topic = "DocumentInstanceController") @Tag(name = "DocumentInstance Controller") public class DocumentInstanceController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/EnforcementController.java b/src/main/java/uk/gov/hmcts/opal/controllers/EnforcementController.java index cae77b280..bbcdfcd1a 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/EnforcementController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/EnforcementController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/enforcements") +@RequestMapping("/api/enforcement") @Slf4j(topic = "EnforcementController") @Tag(name = "Enforcement Controller") public class EnforcementController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/EnforcerController.java b/src/main/java/uk/gov/hmcts/opal/controllers/EnforcerController.java index d0e0918cc..dcc1c6521 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/EnforcerController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/EnforcerController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/enforcers") +@RequestMapping("/api/enforcer") @Slf4j(topic = "EnforcerController") @Tag(name = "Enforcer Controller") public class EnforcerController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/LocalJusticeAreaController.java b/src/main/java/uk/gov/hmcts/opal/controllers/LocalJusticeAreaController.java index 31fc334b1..286d3641a 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/LocalJusticeAreaController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/LocalJusticeAreaController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/localJusticeAreas") +@RequestMapping("/api/local-justice-area") @Slf4j(topic = "LocalJusticeAreaController") @Tag(name = "LocalJusticeArea Controller") public class LocalJusticeAreaController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/MisDebtorController.java b/src/main/java/uk/gov/hmcts/opal/controllers/MisDebtorController.java index 5f5554da3..fd3cb2e20 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/MisDebtorController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/MisDebtorController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/misDebtors") +@RequestMapping("/api/mis-debtor") @Slf4j(topic = "MisDebtorController") @Tag(name = "MisDebtor Controller") public class MisDebtorController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/NoteController.java b/src/main/java/uk/gov/hmcts/opal/controllers/NoteController.java index 77308af01..872c9123b 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/NoteController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/NoteController.java @@ -23,7 +23,7 @@ @RestController -@RequestMapping("/api/notes") +@RequestMapping("/api/note") @Slf4j(topic = "NoteController") @Tag(name = "Notes Controller") public class NoteController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/PaymentInController.java b/src/main/java/uk/gov/hmcts/opal/controllers/PaymentInController.java index 78d552473..1ca322617 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/PaymentInController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/PaymentInController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/paymentIns") +@RequestMapping("/api/payment-in") @Slf4j(topic = "PaymentInController") @Tag(name = "PaymentIn Controller") public class PaymentInController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/PaymentTermsController.java b/src/main/java/uk/gov/hmcts/opal/controllers/PaymentTermsController.java index a729d2536..96230b878 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/PaymentTermsController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/PaymentTermsController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/paymentTerms") +@RequestMapping("/api/payment-terms") @Slf4j(topic = "PaymentTermsController") @Tag(name = "PaymentTerms Controller") public class PaymentTermsController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/PrisonController.java b/src/main/java/uk/gov/hmcts/opal/controllers/PrisonController.java index d28fae44b..25057226f 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/PrisonController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/PrisonController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/prisons") +@RequestMapping("/api/prison") @Slf4j(topic = "PrisonController") @Tag(name = "Prison Controller") public class PrisonController { diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/TillController.java b/src/main/java/uk/gov/hmcts/opal/controllers/TillController.java index 29dbb24a6..98a8b96ff 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/TillController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/TillController.java @@ -22,7 +22,7 @@ @RestController -@RequestMapping("/api/tills") +@RequestMapping("/api/till") @Slf4j(topic = "TillController") @Tag(name = "Till Controller") public class TillController { diff --git a/src/test/java/uk/gov/hmcts/opal/controllers/DefendantAccountControllerTest.java b/src/test/java/uk/gov/hmcts/opal/controllers/DefendantAccountControllerTest.java index 84e899f1c..b126212d9 100644 --- a/src/test/java/uk/gov/hmcts/opal/controllers/DefendantAccountControllerTest.java +++ b/src/test/java/uk/gov/hmcts/opal/controllers/DefendantAccountControllerTest.java @@ -92,25 +92,6 @@ public void testPutDefendantAccount_Success() { DefendantAccountEntity.class)); } - @Test - public void testGetDefendantAccounts_Success() { - // Arrange - List mockResponse = List.of(new DefendantAccountEntity()); - - when(defendantAccountService.getDefendantAccountsByBusinessUnit(any(Short.class))).thenReturn(mockResponse); - - // Act - ResponseEntity> responseEntity = defendantAccountController - .getDefendantAccountsByBusinessUnit(any(Short.class)); - - // Assert - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); - assertEquals(mockResponse, responseEntity.getBody()); - verify(defendantAccountService, times(1)).getDefendantAccountsByBusinessUnit(any( - Short.class)); - - } - @Test public void testGetDefendantAccountDetails_Success() { // Arrange