use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.
the class AbstractDatabaseOffsetKafkaStoreTest method generateAndSaveBinlogFileOffset.
private BinlogFileOffset generateAndSaveBinlogFileOffset() throws InterruptedException {
BinlogFileOffset bfo = generateBinlogFileOffset();
DatabaseOffsetKafkaStore binlogOffsetKafkaStore = getDatabaseOffsetKafkaStore(eventuateConfigurationProperties.getDbHistoryTopicName(), "mySqlBinaryLogClientName");
binlogOffsetKafkaStore.save(bfo);
Thread.sleep(5000);
BinlogFileOffset savedBfo = binlogOffsetKafkaStore.getLastBinlogFileOffset().get();
assertEquals(bfo, savedBfo);
binlogOffsetKafkaStore.stop();
return savedBfo;
}
use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.
the class AbstractDatabaseOffsetKafkaStoreTest method shouldGetEmptyOptionalFromEmptyTopic.
@Test
public void shouldGetEmptyOptionalFromEmptyTopic() {
DatabaseOffsetKafkaStore databaseOffsetKafkaStore = getDatabaseOffsetKafkaStore(UUID.randomUUID().toString(), "mySqlBinaryLogClientName");
databaseOffsetKafkaStore.getLastBinlogFileOffset().isPresent();
databaseOffsetKafkaStore.stop();
}
use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.
the class AbstractDatabaseOffsetKafkaStoreTest method assertLastRecordEquals.
private void assertLastRecordEquals(BinlogFileOffset binlogFileOffset) {
DatabaseOffsetKafkaStore binlogOffsetKafkaStore = getDatabaseOffsetKafkaStore(eventuateConfigurationProperties.getDbHistoryTopicName(), "mySqlBinaryLogClientName");
BinlogFileOffset lastRecord = binlogOffsetKafkaStore.getLastBinlogFileOffset().get();
assertEquals(binlogFileOffset, lastRecord);
binlogOffsetKafkaStore.stop();
}
Aggregations