2222@ DisplayName ("Get Document Type Test Suite" )
2323public class GetDocumentTypesTest {
2424 private static final String DOCUMENT_TYPE_CD = "ACODE" ;
25+ private static final String DOCUMENT_TYPE_OTHER_CD = "OTH" ;
2526 private static final String DESCRIPTION = "DESCRIPTION" ;
2627 private static final String NODOC = "NODOC" ;
2728 public static final String COURT_LEVEL = "level1" ;
@@ -36,15 +37,8 @@ public class GetDocumentTypesTest {
3637 public void setUp () throws NestedEjbException_Exception {
3738
3839 MockitoAnnotations .openMocks (this );
39- DocumentType documentType = new DocumentType ();
40- documentType .setDocumentTypeCd (DOCUMENT_TYPE_CD );
41- documentType .setDocumentTypeDesc (DESCRIPTION );
42- documentType .setDefaultStatutoryFee (BigDecimal .TEN );
43- documentType .setOrderDocumentYn (true );
44- documentType .setRushRequiredYn (true );
45- documentType .setAutoProcessYn (false );
46-
47- Mockito .when (filingStatusFacadeBean .getDocumentTypes (Mockito .eq (COURT_LEVEL ),any ())).thenReturn (Arrays .asList (documentType ));
40+
41+ Mockito .when (filingStatusFacadeBean .getDocumentTypes (Mockito .eq (COURT_LEVEL ),any ())).thenReturn (createDocumentTypeList ());
4842 Mockito .when (filingStatusFacadeBean .getDocumentTypes (Mockito .eq (NODOC ),any ())).thenReturn (new ArrayList <>());
4943
5044 Mockito .when (filingStatusFacadeBean .getDocumentTypes (Mockito .eq (EXCEPTION ),any ())).thenThrow (NestedEjbException_Exception .class );
@@ -56,15 +50,19 @@ public void setUp() throws NestedEjbException_Exception {
5650 @ Test
5751 public void testWithFoundResult () {
5852 List <DocumentTypeDetails > result = sut .getDocumentTypes (COURT_LEVEL , COURT_CLASS );
53+
54+ Assertions .assertEquals (1 , result .size ());
5955 Assertions .assertEquals (DESCRIPTION , result .get (0 ).getDescription ());
6056 Assertions .assertEquals (DOCUMENT_TYPE_CD , result .get (0 ).getType ());
57+
6158 }
6259
6360 @ DisplayName ("Failure: when SOAP service throws NestedEjbException_Exception, service should throw EfilingDocumentServiceException" )
6461 @ Test
6562 public void testThrowException () throws NestedEjbException_Exception {
6663
6764 Assertions .assertThrows (EfilingDocumentServiceException .class , () -> sut .getDocumentTypes (EXCEPTION , COURT_CLASS ));
65+
6866 }
6967
7068 @ DisplayName ("Exception: courtLevel is required" )
@@ -87,4 +85,27 @@ public void whenCourtClassIsBlankShouldThrowIllegalArgumentException() {
8785
8886 }
8987
88+ private List <DocumentType > createDocumentTypeList () {
89+
90+ DocumentType documentType1 = new DocumentType ();
91+ documentType1 .setDocumentTypeCd (DOCUMENT_TYPE_CD );
92+ documentType1 .setDocumentTypeDesc (DESCRIPTION );
93+ documentType1 .setDefaultStatutoryFee (BigDecimal .TEN );
94+ documentType1 .setOrderDocumentYn (true );
95+ documentType1 .setRushRequiredYn (true );
96+ documentType1 .setAutoProcessYn (false );
97+
98+ DocumentType documentType2 = new DocumentType ();
99+ documentType2 .setDocumentTypeCd (DOCUMENT_TYPE_OTHER_CD );
100+ documentType2 .setDocumentTypeDesc (DESCRIPTION );
101+ documentType2 .setDefaultStatutoryFee (BigDecimal .TEN );
102+ documentType2 .setOrderDocumentYn (true );
103+ documentType2 .setRushRequiredYn (true );
104+ documentType2 .setAutoProcessYn (false );
105+
106+ return Arrays .asList (documentType1 , documentType2 );
107+
108+ }
109+
110+
90111}
0 commit comments