Skip to content

Commit

Permalink
Merge branch 'master' into DMP-4580
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Edwards-cgi authored Jan 22, 2025
2 parents aed5b4b + 0871560 commit ce565b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ void courthousesGet_ThreeCourthousesAssignedToUser() throws Exception {
MockHttpServletRequestBuilder requestBuilder = get("/courthouses")
.contentType(MediaType.APPLICATION_JSON_VALUE);
MvcResult response = mockMvc.perform(requestBuilder).andExpect(status().isOk())
.andExpect(jsonPath("$[0].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(LEEDS_COURT)))
.andExpect(jsonPath("$[2].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[0].courthouse_name", is(LEEDS_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[2].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andExpect(jsonPath("$[3].courthouse_name").doesNotExist())
.andDo(print()).andReturn();

Expand Down Expand Up @@ -318,8 +318,8 @@ void courthousesGet_TwoCourthousesAssignedToUser() throws Exception {
MockHttpServletRequestBuilder requestBuilder = get("/courthouses")
.contentType(MediaType.APPLICATION_JSON_VALUE);
MvcResult response = mockMvc.perform(requestBuilder).andExpect(status().isOk())
.andExpect(jsonPath("$[0].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[0].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andExpect(jsonPath("$[2].courthouse_name").doesNotExist())
.andDo(print()).andReturn();

Expand Down Expand Up @@ -352,8 +352,8 @@ void courthousesGetRequestedByJudge() throws Exception {
.contentType(MediaType.APPLICATION_JSON_VALUE);
MvcResult response = mockMvc.perform(requestBuilder).andExpect(status().isOk())
.andExpect(jsonPath("$[0].courthouse_name", is(LEEDS_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andExpect(jsonPath("$[2].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[1].courthouse_name", is(MANCHESTER_COURT)))
.andExpect(jsonPath("$[2].courthouse_name", is(SWANSEA_CROWN_COURT)))
.andDo(print()).andReturn();

assertEquals(200, response.getResponse().getStatus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public List<ExtendedCourthouse> mapFromEntitiesToExtendedCourthouses(List<Courth
extendedCourthouse.setRegionId(courthouseEntity.getRegion() == null ? null : courthouseEntity.getRegion().getId());
extendedCourthouses.add(extendedCourthouse);
});

extendedCourthouses.sort((o1, o2) -> o1.getCourthouseName().compareTo(o2.getCourthouseName()));
return extendedCourthouses;
}

Expand Down

0 comments on commit ce565b3

Please sign in to comment.