diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerGetTranscriptionTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerGetTranscriptionTest.java index c6b60a10f53..189d7256194 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerGetTranscriptionTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerGetTranscriptionTest.java @@ -63,7 +63,7 @@ void setUp() { } @Test - void getTranscription() throws Exception { + void givenExistingTranscription_whenGetTranscriptionDetailsIsRequested_thenDetailsAreReturned() throws Exception { HearingEntity hearingEntity = dartsDatabase.getHearingRepository().findAll().get(0); TranscriptionEntity transcription = dartsDatabase.getTranscriptionStub().createTranscription(hearingEntity); transcription.setCreatedDateTime(OffsetDateTime.of(2023, 6, 20, 10, 0, 0, 0, ZoneOffset.UTC)); @@ -117,7 +117,7 @@ private void addCommentToWorkflow(TranscriptionWorkflowEntity workflowEntity, St } @Test - void getTranscriptionNotFound() throws Exception { + void whenGetTranscriptionDetailsForNonExistingTranscriptionIsRequested_thenErrorIsReturned() throws Exception { MockHttpServletRequestBuilder requestBuilder = get(ENDPOINT_URL_TRANSCRIPTION, -999); MvcResult response = mockMvc.perform(requestBuilder).andExpect(status().isNotFound()).andReturn(); String actualResponse = response.getResponse().getContentAsString(); diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerUpdateTranscriptionApprovedIntTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerUpdateTranscriptionApprovedIntTest.java index de196d09800..cb62d7959a9 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerUpdateTranscriptionApprovedIntTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/transcriptions/controller/TranscriptionControllerUpdateTranscriptionApprovedIntTest.java @@ -95,7 +95,7 @@ void beforeEach() { } @Test - void updateTranscriptionApprovedWithoutComment() throws Exception { + void givenAwaitingAuthorisationTranscription_whenApproveWithoutCommentIsRequested_thenNewStatusIsApprovedAndHasNoComment() throws Exception { TranscriptionEntity existingTranscription = dartsDatabase.getTranscriptionRepository().findById( transcriptionId).orElseThrow(); @@ -145,7 +145,7 @@ void updateTranscriptionApprovedWithoutComment() throws Exception { } @Test - void updateTranscriptionApprovedWithComment() throws Exception { + void givenAwaitingAuthorisationTranscription_whenApproveWithCommentIsRequested_thenNewStatusIsApprovedAndHasComment() throws Exception { UpdateTranscription updateTranscription = new UpdateTranscription(); updateTranscription.setTranscriptionStatusId(APPROVED.getId()); @@ -190,7 +190,7 @@ void updateTranscriptionApprovedWithComment() throws Exception { } @Test - void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exception { + void whenUpdateTranscriptionForNonExistingTranscriptionIsRequested_thenErrorIsReturned() throws Exception { UpdateTranscription updateTranscription = new UpdateTranscription(); updateTranscription.setTranscriptionStatusId(APPROVED.getId()); updateTranscription.setWorkflowComment("APPROVED"); @@ -216,7 +216,7 @@ void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exceptio } @Test - void updateTranscriptionShouldReturnTranscriptionWorkflowActionInvalidError() throws Exception { + void givenExistingTranscription_whenUpdateToInvalidStatusIsRequested_thenErrorIsReturned() throws Exception { UpdateTranscription updateTranscription = new UpdateTranscription(); updateTranscription.setTranscriptionStatusId(WITH_TRANSCRIBER.getId()); updateTranscription.setWorkflowComment("APPROVED"); diff --git a/src/test/java/uk/gov/hmcts/darts/audio/component/impl/AddAudioRequestMapperImplTest.java b/src/test/java/uk/gov/hmcts/darts/audio/component/impl/AddAudioRequestMapperImplTest.java index dc8e9faa5be..5f25b4d7892 100644 --- a/src/test/java/uk/gov/hmcts/darts/audio/component/impl/AddAudioRequestMapperImplTest.java +++ b/src/test/java/uk/gov/hmcts/darts/audio/component/impl/AddAudioRequestMapperImplTest.java @@ -31,7 +31,7 @@ void setUp() { } @Test - void testMapToMedia() { + void givenCourtroomExistsOrCreated_whenMapCourtroomAudioMetadataToMediaIsRequested_thenMetadataIsSuccessfullyMapped() { CourthouseEntity courthouse = new CourthouseEntity(); courthouse.setCourthouseName("SWANSEA"); diff --git a/src/test/java/uk/gov/hmcts/darts/event/service/impl/EventDispatcherImplTest.java b/src/test/java/uk/gov/hmcts/darts/event/service/impl/EventDispatcherImplTest.java index 252b1d126f2..7d147731ed0 100644 --- a/src/test/java/uk/gov/hmcts/darts/event/service/impl/EventDispatcherImplTest.java +++ b/src/test/java/uk/gov/hmcts/darts/event/service/impl/EventDispatcherImplTest.java @@ -28,7 +28,7 @@ class EventDispatcherImplTest { EventHandlerRepository eventHandlerRepository; @Test - void receiveWithNoHandlers() { + void givenMatchingEventHandlerOnDatabaseDoesNotExist_whenReceiveEventIsRequested_thenErrorIsReturned() { List eventHandlers = new ArrayList<>(); when(eventHandlerRepository.findByTypeAndSubType(anyString(), anyString())).thenReturn(Collections.emptyList()); EventDispatcherImpl eventDispatcher = new EventDispatcherImpl(eventHandlers, eventHandlerRepository); @@ -47,7 +47,7 @@ void receiveWithNoHandlers() { } @Test - void receiveWithOneHandlers() { + void givenMatchingEventHandlerExists_whenReceiveEventIsRequested_thenEventIsSuccessfullyReceived() { EventHandlerEntity eventHandlerEntity = new EventHandlerEntity(); when(eventHandlerRepository.findByTypeAndSubType(anyString(), anyString())).thenReturn(List.of(eventHandlerEntity));