use of org.zalando.nakadi.service.timeline.TimelineSyncImpl in project nakadi by zalando.
the class TimelineSyncAT method createTimeline.
private TimelineSyncImpl createTimeline() throws InterruptedException {
if (null == uuidGenerator) {
uuidGenerator = new UUIDGenerator();
}
if (null == zookeeperHolder) {
zookeeperHolder = Mockito.mock(ZooKeeperHolder.class);
Mockito.when(zookeeperHolder.get()).thenReturn(CURATOR);
}
final TimelineSyncImpl result = new TimelineSyncImpl(zookeeperHolder, uuidGenerator);
synchronized (DELAYED_RUNS) {
DELAYED_RUNS.add(() -> {
try {
result.reactOnEventTypesChange();
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
}
});
}
return result;
}
use of org.zalando.nakadi.service.timeline.TimelineSyncImpl in project nakadi by zalando.
the class TimelineSyncAT method testNodeInformationWrittenOnStart.
@Test
public void testNodeInformationWrittenOnStart() throws Exception {
final TimelineSyncImpl sync = createTimeline();
final String currentVersion = new String(CURATOR.getData().forPath("/nakadi/timelines/version"));
Assert.assertEquals(currentVersion, new String(CURATOR.getData().forPath("/nakadi/timelines/nodes/" + sync.getNodeId())));
}
Aggregations