@Test public void should_sort_data_using_data_type_of_current_dataset() throws Exception { final AssertionErrorCollector errorCollector = new AssertionErrorCollector(); DataSetComparator dataSetComparator = new DataSetComparator(new String[] {"id"}, new String[] {"username"}, noCustomFilters()); IDataSet current = DataSetBuilder.builderFor(Format.YAML).build("datasets/three-users.yml"); IDataSet expected = DataSetBuilder.builderFor(Format.YAML).build("datasets/three-users.yml"); Column firstColumn = spyOnFirstColumn(current); doReturn(DataType.BIGINT).when(firstColumn).getDataType(); dataSetComparator.compare(current, expected, errorCollector); errorCollector.report(); assertThat(errorCollector.amountOfErrors()).isZero(); verify(firstColumn, atLeastOnce()).getDataType(); }
public void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector) throws DatabaseUnitException { if (expectedDataSet.getTableNames().length == 0) { shouldBeEmpty(currentDataSet, errorCollector); } else { compareContent(currentDataSet, expectedDataSet, errorCollector); } }
DataSetComparator { public void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector) throws DatabaseUnitException { if (expectedDataSet.getTableNames().length == 0) { shouldBeEmpty(currentDataSet, errorCollector); } else { compareContent(currentDataSet, expectedDataSet, errorCollector); } } }
DataSetComparator { public void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector) throws DatabaseUnitException { if (expectedDataSet.getTableNames().length == 0) { shouldBeEmpty(currentDataSet, errorCollector); } else { compareContent(currentDataSet, expectedDataSet, errorCollector); } } DataSetComparator(final String[] orderBy, final String[] toExclude,
        Set<Class<? extends IColumnFilter>> columnFilters); }
DataSetComparator { public void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector) throws DatabaseUnitException { if (expectedDataSet.getTableNames().length == 0) { shouldBeEmpty(currentDataSet, errorCollector); } else { compareContent(currentDataSet, expectedDataSet, errorCollector); } } DataSetComparator(final String[] orderBy, final String[] toExclude,
        Set<Class<? extends IColumnFilter>> columnFilters); void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector); void compareContent(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector); void shouldBeEmpty(IDataSet dataSet, AssertionErrorCollector errorCollector); void shouldBeEmpty(IDataSet dataSet, String tableName, AssertionErrorCollector errorCollector); }
DataSetComparator { public void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector) throws DatabaseUnitException { if (expectedDataSet.getTableNames().length == 0) { shouldBeEmpty(currentDataSet, errorCollector); } else { compareContent(currentDataSet, expectedDataSet, errorCollector); } } DataSetComparator(final String[] orderBy, final String[] toExclude,
        Set<Class<? extends IColumnFilter>> columnFilters); void compare(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector); void compareContent(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector); void shouldBeEmpty(IDataSet dataSet, AssertionErrorCollector errorCollector); void shouldBeEmpty(IDataSet dataSet, String tableName, AssertionErrorCollector errorCollector);  }