InventoryDataTaskSplitter { public Collection<ScalingTask<InventoryPosition>> splitInventoryData(final SyncConfiguration syncConfig, final DataSourceManager dataSourceManager) { Collection<ScalingTask<InventoryPosition>> result = new LinkedList<>(); for (InventoryDumperConfiguration each : splitDumperConfiguration(syncConfig.getConcurrency(), syncConfig.getDumperConfiguration(), dataSourceManager)) { result.add(syncTaskFactory.createInventoryDataSyncTask(each, syncConfig.getImporterConfiguration())); } return result; }  Collection<ScalingTask<InventoryPosition>> splitInventoryData(final SyncConfiguration syncConfig, final DataSourceManager dataSourceManager);  }
@Test public void assertSplitInventoryDataWithIntPrimary() throws SQLException { initIntPrimaryEnvironment(syncConfig.getDumperConfiguration()); Collection<ScalingTask<InventoryPosition>> actual = inventoryDataTaskSplitter.splitInventoryData(syncConfig, dataSourceManager); assertNotNull(actual); assertThat(actual.size(), is(3)); }
@Test public void assertSplitInventoryDataWithCharPrimary() throws SQLException { initCharPrimaryEnvironment(syncConfig.getDumperConfiguration()); Collection<ScalingTask<InventoryPosition>> actual = inventoryDataTaskSplitter.splitInventoryData(syncConfig, dataSourceManager); assertNotNull(actual); assertThat(actual.size(), is(1)); }
@Test public void assertSplitInventoryDataWithUnionPrimary() throws SQLException { initUnionPrimaryEnvironment(syncConfig.getDumperConfiguration()); Collection<ScalingTask<InventoryPosition>> actual = inventoryDataTaskSplitter.splitInventoryData(syncConfig, dataSourceManager); assertNotNull(actual); assertThat(actual.size(), is(1)); }
@Test public void assertSplitInventoryDataWithoutPrimary() throws SQLException { initNoPrimaryEnvironment(syncConfig.getDumperConfiguration()); Collection<ScalingTask<InventoryPosition>> actual = inventoryDataTaskSplitter.splitInventoryData(syncConfig, dataSourceManager); assertNotNull(actual); assertThat(actual.size(), is(1)); }