Skip to content

Commit

Permalink
CCMSPUI-379 Fixed broken tests in ClientsControllerTest and ClientDet…
Browse files Browse the repository at this point in the history
…ailsMapperImplTest

Signed-off-by: Jamie Briggs <jamie.briggs@digital.justice.gov.uk>
  • Loading branch information
Jamie Briggs committed Feb 18, 2025
1 parent 4353f23 commit 16273a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.laa.ccms.data.controller;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
Expand Down Expand Up @@ -109,9 +109,10 @@ void shouldReturnData() throws Exception {
// Given
ClientDetails details = new ClientDetails().addContentItem(new ClientSummary()
.clientReferenceNumber("123"));
when(clientService.getClients(anyString(), anyString(), any(), anyString(),
anyString(), anyString(), anyString(), any()))
.thenReturn(Optional.of(details));
doReturn(Optional.of(details)).when(clientService).getClients(
any(), any(), any(), any(),
any(), any(), any(), any());

// Then
String jsonContent = objectMapper.writeValueAsString(details);
mockMvc.perform(get("/clients"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ private static ClientDetail getTestClientDetail() {
.noFixAbode("false")
.nationalInsuranceNumber("NINO")
.homeOfficeNumber("Home Office Number")
// TODO Add address again once address has been added
//.address("<Address><AddressID>52731</AddressID><House>26</House><AddressLine1>26, Grange Avenue</AddressLine1><City>BILLINGHAM</City><Country>GBR</Country><PostalCode>TS23 1JH</PostalCode></Address>")
.address("<Address><AddressID>52731</AddressID><House>26</House><AddressLine1>26, Grange Avenue</AddressLine1><City>BILLINGHAM</City><Country>GBR</Country><PostalCode>TS23 1JH</PostalCode></Address>")
.build();
}
}

0 comments on commit 16273a8

Please sign in to comment.