use of com.datastax.oss.dsbulk.workflow.commons.schema.ReadResultCounter in project dsbulk by datastax.
the class SchemaSettingsTest method should_create_row_counter_for_global_stats.
@Test
void should_create_row_counter_for_global_stats() {
when(table.getPrimaryKey()).thenReturn(newArrayList(col1, col2));
Config config = TestConfigUtils.createTestConfig("dsbulk.schema", "keyspace", "ks", "table", "t1");
SchemaSettings settings = new SchemaSettings(config, READ_AND_COUNT);
settings.init(session, codecFactory, false, true);
ReadResultCounter counter = settings.createReadResultCounter(session, codecFactory, EnumSet.of(global), 10);
assertThat(counter).isNotNull();
ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class);
verify(session).prepare(argument.capture());
assertThat(argument.getValue()).isEqualTo("SELECT c1 FROM ks.t1 WHERE token(c1) > :start AND token(c1) <= :end");
}
Aggregations