diff --git a/build.gradle b/build.gradle index 8222161fafc..3e3205faad0 100644 --- a/build.gradle +++ b/build.gradle @@ -513,7 +513,7 @@ dependencies { // https://mvnrepository.com/artifact/org.awaitility/awaitility-proxy testImplementation group: 'org.awaitility', name: 'awaitility-proxy', version: '3.1.6' testImplementation 'io.github.hakky54:logcaptor:2.12.6' - testImplementation 'org.testcontainers:testcontainers:1.21.4' + testImplementation 'org.testcontainers:testcontainers:2.0.5' testImplementation group: 'org.jeasy', name: 'easy-random-core', version: '5.0.0' diff --git a/src/functionalTest/java/uk/gov/hmcts/darts/common/HiddenReasonFunctionalTest.java b/src/functionalTest/java/uk/gov/hmcts/darts/common/HiddenReasonFunctionalTest.java index b6a7e2ab37c..e0d36ddbd4e 100644 --- a/src/functionalTest/java/uk/gov/hmcts/darts/common/HiddenReasonFunctionalTest.java +++ b/src/functionalTest/java/uk/gov/hmcts/darts/common/HiddenReasonFunctionalTest.java @@ -10,7 +10,7 @@ import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; class HiddenReasonFunctionalTest extends FunctionalTest { diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/DownloadProductionServiceIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/DownloadProductionServiceIntTest.java index 9af6041ce6d..6fd039a894d 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/DownloadProductionServiceIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/DownloadProductionServiceIntTest.java @@ -18,9 +18,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/GetIndexesByMatterIdServiceIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/GetIndexesByMatterIdServiceIntTest.java index 2c29d3ba5f2..48b1a5182f8 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/GetIndexesByMatterIdServiceIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/GetIndexesByMatterIdServiceIntTest.java @@ -19,9 +19,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/RemoveProductionServiceIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/RemoveProductionServiceIntTest.java index 8c1fa636e83..cff282904fb 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/RemoveProductionServiceIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/arm/rpo/RemoveProductionServiceIntTest.java @@ -16,8 +16,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/audio/controller/AudioControllerAddAudioMetadataIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/audio/controller/AudioControllerAddAudioMetadataIntTest.java index f562bda0bf2..2e06bd86da5 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/audio/controller/AudioControllerAddAudioMetadataIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/audio/controller/AudioControllerAddAudioMetadataIntTest.java @@ -57,9 +57,9 @@ import java.util.function.Function; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/audio/service/impl/MediaRequestServiceTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/audio/service/impl/MediaRequestServiceTest.java index d6f685c2a1a..6aa27101ad3 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/audio/service/impl/MediaRequestServiceTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/audio/service/impl/MediaRequestServiceTest.java @@ -24,9 +24,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.within; -import static org.junit.Assert.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/cases/controller/CaseControllerAdminGetCaseByIdIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/cases/controller/CaseControllerAdminGetCaseByIdIntTest.java index 200b726b8cd..68b663c33c6 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/cases/controller/CaseControllerAdminGetCaseByIdIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/cases/controller/CaseControllerAdminGetCaseByIdIntTest.java @@ -134,8 +134,8 @@ void adminGetCaseById_WithCaseOpenAndReportingRestrictions() throws Exception { String actualResponse = mvcResult.getResponse().getContentAsString(); String expectedResponse = getContentsFromFile( "tests/cases/CaseControllerAdminGetCaseByIdTest/testCaseOpen/expectedResponse.json"); - expectedResponse = expectedResponse.replace("", courtCase.getCreatedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)); - expectedResponse = expectedResponse.replace("", courtCase.getLastModifiedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)); + expectedResponse = expectedResponse.replace("", formatAsUtc(courtCase.getCreatedDateTime())); + expectedResponse = expectedResponse.replace("", formatAsUtc(courtCase.getLastModifiedDateTime())); JSONAssert.assertEquals(expectedResponse, actualResponse, JSONCompareMode.NON_EXTENSIBLE); } @@ -176,8 +176,8 @@ void adminGetCaseById_WithCaseClosedAndReportingRestrictions() throws Exception String actualResponse = mvcResult.getResponse().getContentAsString(); String expectedResponse = getContentsFromFile( "tests/cases/CaseControllerAdminGetCaseByIdTest/testCaseClosed/expectedResponse.json"); - expectedResponse = expectedResponse.replace("", courtCase.getCreatedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)); - expectedResponse = expectedResponse.replace("", courtCase.getLastModifiedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)); + expectedResponse = expectedResponse.replace("", formatAsUtc(courtCase.getCreatedDateTime())); + expectedResponse = expectedResponse.replace("", formatAsUtc(courtCase.getLastModifiedDateTime())); JSONAssert.assertEquals(expectedResponse, actualResponse, JSONCompareMode.NON_EXTENSIBLE); } @@ -213,8 +213,8 @@ void adminGetCaseById_IsAnonymised() throws Exception { String expectedResponse = getContentsFromFile( "tests/cases/CaseControllerAdminGetCaseByIdTest/testIsAnonymised/expectedResponse.json"); expectedResponse = expectedResponse - .replace("", courtCase.getCreatedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)) - .replace("", courtCase.getLastModifiedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)) + .replace("", formatAsUtc(courtCase.getCreatedDateTime())) + .replace("", formatAsUtc(courtCase.getLastModifiedDateTime())) .replace("", String.valueOf(anonymisedBy.getId())); JSONAssert.assertEquals(expectedResponse, actualResponse, JSONCompareMode.NON_EXTENSIBLE); } @@ -248,8 +248,8 @@ void adminGetCaseById_IsDeleted() throws Exception { String expectedResponse = getContentsFromFile( "tests/cases/CaseControllerAdminGetCaseByIdTest/expectedResponse_isDeleted.json"); expectedResponse = expectedResponse - .replace("", courtCase.getCreatedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)) - .replace("", courtCase.getLastModifiedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)) + .replace("", formatAsUtc(courtCase.getCreatedDateTime())) + .replace("", formatAsUtc(courtCase.getLastModifiedDateTime())) .replace("", String.valueOf(deletedBy.getId())); JSONAssert.assertEquals(expectedResponse, actualResponse, JSONCompareMode.NON_EXTENSIBLE); } @@ -299,8 +299,8 @@ void adminGetCaseById_WithRetentionAndAdditionalCaseDetails() throws Exception { String expectedResponse = getContentsFromFile( "tests/cases/CaseControllerAdminGetCaseByIdTest/expectedResponse_withRetentionAndAdditionalCaseDetails.json"); expectedResponse = expectedResponse - .replace("", courtCase.getCreatedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)) - .replace("", courtCase.getLastModifiedDateTime().format(DateTimeFormatter.ISO_DATE_TIME)); + .replace("", formatAsUtc(courtCase.getCreatedDateTime())) + .replace("", formatAsUtc(courtCase.getLastModifiedDateTime())); JSONAssert.assertEquals(expectedResponse, actualResponse, JSONCompareMode.NON_EXTENSIBLE); } @@ -328,4 +328,8 @@ private List createEventsWithDifferentTimestamps(List DataGenerator.createUniqueFile(DataSize.ofBytes(1), DataGenerator.FileType.MP2) );