Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setUp() {
}

@Test
void getTranscription() throws Exception {
void givenExistingTranscription_whenGetTranscriptionIsRequested_thenTheDetailsAreReturned() 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));
Expand Down Expand Up @@ -117,7 +117,7 @@ private void addCommentToWorkflow(TranscriptionWorkflowEntity workflowEntity, St
}

@Test
void getTranscriptionNotFound() throws Exception {
void givenRequestedTranscriptionDoesNotExist_whenGetTranscriptionIsRequested_thenTranscriptionNotFoundErrorIsReturned() throws Exception {
MockHttpServletRequestBuilder requestBuilder = get(ENDPOINT_URL_TRANSCRIPTION, -999);
MvcResult response = mockMvc.perform(requestBuilder).andExpect(status().isNotFound()).andReturn();
String actualResponse = response.getResponse().getContentAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void beforeEach() {
}

@Test
void updateTranscriptionApprovedWithoutComment() throws Exception {
void givenAwaitingAuthorisationTranscription_whenApproveWithoutCommentIsRequested_thenNewStatusIsApprovedAndHasNoComment() throws Exception {

TranscriptionEntity existingTranscription = dartsDatabase.getTranscriptionRepository().findById(
transcriptionId).orElseThrow();
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -190,7 +190,9 @@ void updateTranscriptionApprovedWithComment() throws Exception {
}

@Test
void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exception {
// alternative naming if we want to allow empty given
// void given_whenUpdateTranscriptionForNonExistingTranscriptionIsRequested_thenTranscriptionNotFoundErrorIsReturned() throws Exception {
void givenRequestedTranscriptionDoesNotExist_whenUpdateTranscriptionIsRequested_thenTranscriptionNotFoundErrorIsReturned() throws Exception {
UpdateTranscription updateTranscription = new UpdateTranscription();
updateTranscription.setTranscriptionStatusId(APPROVED.getId());
updateTranscription.setWorkflowComment("APPROVED");
Expand All @@ -216,7 +218,7 @@ void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exceptio
}

@Test
void updateTranscriptionShouldReturnTranscriptionWorkflowActionInvalidError() throws Exception {
void givenExistingTranscription_whenUpdateToInvalidStatusIsRequested_thenTranscriptionWorkflowActionInvalidErrorIsReturned() throws Exception {
UpdateTranscription updateTranscription = new UpdateTranscription();
updateTranscription.setTranscriptionStatusId(WITH_TRANSCRIBER.getId());
updateTranscription.setWorkflowComment("APPROVED");
Expand Down