use of org.apache.kafka.common.utils.MockScheduler in project kafka by apache.
the class CoordinatorTest method testCoordinatorUptime.
@Test
public void testCoordinatorUptime() throws Exception {
MockTime time = new MockTime(0, 200, 0);
Scheduler scheduler = new MockScheduler(time);
try (MiniTrogdorCluster cluster = new MiniTrogdorCluster.Builder().addCoordinator("node01").scheduler(scheduler).build()) {
UptimeResponse uptime = cluster.coordinatorClient().uptime();
assertEquals(cluster.coordinator().uptime(), uptime);
time.setCurrentTimeMs(250);
assertNotEquals(cluster.coordinator().uptime(), uptime);
}
}
Aggregations