From 0871560eddd2081b1a9788c5396acc61c7dda0b7 Mon Sep 17 00:00:00 2001 From: Ben Edwards <147524406+Ben-Edwards-cgi@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:37:23 +0000 Subject: [PATCH] DMP-4619: Courthouse search results look to default sorting to last updated date (#2463) Co-authored-by: Jack Maloney --- .../darts/common/controller/CourthouseApiTest.java | 14 +++++++------- .../service/impl/CourthouseServiceImpl.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/common/controller/CourthouseApiTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/common/controller/CourthouseApiTest.java index 5610a5bb13..b3fd4163d9 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/common/controller/CourthouseApiTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/common/controller/CourthouseApiTest.java @@ -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(); @@ -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(); @@ -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()); diff --git a/src/main/java/uk/gov/hmcts/darts/courthouse/service/impl/CourthouseServiceImpl.java b/src/main/java/uk/gov/hmcts/darts/courthouse/service/impl/CourthouseServiceImpl.java index 339f8bdc7e..28b870af95 100644 --- a/src/main/java/uk/gov/hmcts/darts/courthouse/service/impl/CourthouseServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/darts/courthouse/service/impl/CourthouseServiceImpl.java @@ -120,7 +120,7 @@ public List mapFromEntitiesToExtendedCourthouses(List o1.getCourthouseName().compareTo(o2.getCourthouseName())); return extendedCourthouses; }