Skip to content

Commit

Permalink
CIV-15714 - GA Lip - Unable to upload translated document after appli…
Browse files Browse the repository at this point in the history
…cation is listed for hearing (#1593)

* added code changes and unit tests.

* added a fix.

* fixed doc type issue.

---------

Co-authored-by: Paul Pearson <46532983+paul-pearson@users.noreply.github.com>
  • Loading branch information
neeta-hmcts and paul-pearson authored Nov 29, 2024
1 parent c720505 commit e27a80e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.DISMISSAL_ORDER;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.GENERAL_APPLICATION_DRAFT;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.GENERAL_ORDER;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.HEARING_NOTICE;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.HEARING_ORDER;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.JUDGES_DIRECTIONS_APPLICANT_TRANSLATED;
import static uk.gov.hmcts.reform.civil.model.documents.DocumentType.JUDGES_DIRECTIONS_RESPONDENT_TRANSLATED;
Expand Down Expand Up @@ -56,6 +57,8 @@ public DocumentType getCorrespondingDocumentType(TranslatedDocumentType document
return JUDGES_DIRECTIONS_RESPONDENT_TRANSLATED;
case HEARING_ORDER:
return HEARING_ORDER;
case HEARING_NOTICE:
return HEARING_NOTICE;
case WITHOUT_NOTICE_TO_WITH_NOTICE_DOCUMENT:
return SEND_APP_TO_OTHER_PARTY;
case DISMISSAL_ORDER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ private List<Element<CaseDocument>> getExistingDocumentsByType(CaseData caseData
return ofNullable(caseData.getGeneralOrderDocument()).orElse(new ArrayList<>());
case HEARING_ORDER:
return ofNullable(caseData.getHearingOrderDocument()).orElse(new ArrayList<>());
case HEARING_NOTICE:
return ofNullable(caseData.getHearingNoticeDocument()).orElse(new ArrayList<>());
case DISMISSAL_ORDER:
return ofNullable(caseData.getDismissalOrderDocument()).orElse(new ArrayList<>());
case WRITTEN_REPRESENTATION_CONCURRENT:
Expand Down Expand Up @@ -117,6 +119,9 @@ private void updateCaseDataBuilderByType(CaseData caseData, CaseData.CaseDataBui
case HEARING_ORDER:
caseDataBuilder.hearingOrderDocument(documents);
break;
case HEARING_NOTICE:
caseDataBuilder.hearingNoticeDocument(documents);
break;
case WRITTEN_REPRESENTATION_CONCURRENT:
caseDataBuilder.writtenRepConcurrentDocument(documents);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ void shouldHandleMultipleDocumentTypes() {
.file(mock(Document.class))
.build()).build());

translatedDocuments.add(Element.<TranslatedDocument>builder().value(
TranslatedDocument.builder()
.documentType(TranslatedDocumentType.HEARING_NOTICE)
.file(mock(Document.class))
.build()).build());

translatedDocuments.add(Element.<TranslatedDocument>builder().value(
TranslatedDocument.builder()
.documentType(TranslatedDocumentType.JUDGES_DIRECTIONS_ORDER)
Expand Down Expand Up @@ -142,12 +148,13 @@ void shouldHandleMultipleDocumentTypes() {
// Then
assertThat(result.getGeneralOrderDocument()).isNotNull();
assertThat(result.getHearingOrderDocument()).isNotNull();
assertThat(result.getHearingNoticeDocument()).isNotNull();
assertThat(result.getDirectionOrderDocument()).isNotNull();
assertThat(result.getWrittenRepSequentialDocument()).isNotNull();
assertThat(result.getWrittenRepConcurrentDocument()).isNotNull();
assertThat(result.getDismissalOrderDocument()).isNotNull();
assertThat(result.getGaDraftDocument()).isNotNull();
assertThat(result.getGeneralOrderDocument().get(0).getValue().getCreatedBy()).isEqualTo(translator);
verify(assignCategoryId, times(8)).assignCategoryIdToCollection(anyList(), any(), any());
verify(assignCategoryId, times(9)).assignCategoryIdToCollection(anyList(), any(), any());
}
}

0 comments on commit e27a80e

Please sign in to comment.