Added more functional tests

This commit is contained in:
Eugene Livis 2021-11-12 13:20:36 -05:00
parent a538dda979
commit 27d8a94322

View File

@ -131,10 +131,11 @@ public class TableSearchTest extends NbTestCase {
private static final String HOST_COLUMN = "Host"; private static final String HOST_COLUMN = "Host";
// Communications accounts test // Communications accounts test
private static final String ACCOUNT_TYPE_COLUMN = "Account Type";
private static final String ID_COLUMN = "ID";
private static final String EMAIL_A = "AAA@yahoo.com"; private static final String EMAIL_A = "AAA@yahoo.com";
private static final String EMAIL_B = "BBB@gmail.com"; private static final String EMAIL_B = "BBB@gmail.com";
private static final String EMAIL_C = "CCCCC@funmail.com"; private static final String EMAIL_C = "CCCCC@funmail.com";
private static final String PHONENUM_1 = "111 777 1111"; private static final String PHONENUM_1 = "111 777 1111";
private static final String PHONENUM_2 = "222 333 7777"; private static final String PHONENUM_2 = "222 333 7777";
@ -654,6 +655,20 @@ public class TableSearchTest extends NbTestCase {
assertEquals(1, results.getTotalResultsCount()); assertEquals(1, results.getTotalResultsCount());
assertEquals(1, results.getItems().size()); assertEquals(1, results.getItems().size());
// Check that a few of the expected column names are present
List<String> columnDisplayNames = results.getColumns().stream().map(p -> p.getDisplayName()).collect(Collectors.toList());
assertTrue(columnDisplayNames.contains(ACCOUNT_TYPE_COLUMN));
assertTrue(columnDisplayNames.contains(ID_COLUMN));
// Get the row
RowDTO rowDTO = results.getItems().get(0);
assertTrue(rowDTO instanceof DataArtifactRowDTO);
DataArtifactRowDTO accountResultRowDTO = (DataArtifactRowDTO) rowDTO;
// Check that some of the expected result tag column values are present
assertTrue(accountResultRowDTO.getCellValues().contains(EMAIL_C));
assertTrue(accountResultRowDTO.getCellValues().contains(customFile.getName()));
} catch (ExecutionException ex) { } catch (ExecutionException ex) {
Exceptions.printStackTrace(ex); Exceptions.printStackTrace(ex);
Assert.fail(ex.getMessage()); Assert.fail(ex.getMessage());