use of com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor in project cruise-control by linkedin.
the class BrokerFailureDetectorTest method createBrokerFailureDetector.
private BrokerFailureDetector createBrokerFailureDetector(Queue<Anomaly> anomalies, Time time) {
LoadMonitor mockLoadMonitor = EasyMock.mock(LoadMonitor.class);
EasyMock.expect(mockLoadMonitor.brokersWithPartitions(anyLong())).andAnswer(() -> new HashSet<>(Arrays.asList(0, 1))).anyTimes();
EasyMock.replay(mockLoadMonitor);
Properties props = KafkaCruiseControlUnitTestUtils.getKafkaCruiseControlProperties();
props.setProperty(KafkaCruiseControlConfig.ZOOKEEPER_CONNECT_CONFIG, zookeeper().getConnectionString());
KafkaCruiseControlConfig kafkaCruiseControlConfig = new KafkaCruiseControlConfig(props);
return new BrokerFailureDetector(kafkaCruiseControlConfig, mockLoadMonitor, anomalies, time);
}
Aggregations