use of org.apache.druid.java.util.emitter.EmittingLogger in project druid by druid-io.
the class PendingTaskBasedProvisioningStrategyTest method testFailIfMinWorkerIsZeroAndWorkerHintNotSet.
@Test
public void testFailIfMinWorkerIsZeroAndWorkerHintNotSet() {
EmittingLogger mockLogger = EasyMock.createMock(EmittingLogger.class);
Capture<String> capturedArgument = Capture.newInstance();
mockLogger.error(EasyMock.capture(capturedArgument), EasyMock.anyInt());
PendingTaskBasedWorkerProvisioningConfig config = new PendingTaskBasedWorkerProvisioningConfig().setMaxScalingDuration(new Period(1000)).setNumEventsToTrack(10).setPendingTaskTimeout(new Period(0)).setWorkerVersion(MIN_VERSION).setMaxScalingStep(2);
EasyMock.expect(autoScaler.getMinNumWorkers()).andReturn(0);
EasyMock.replay(autoScaler, mockLogger);
DefaultWorkerBehaviorConfig defaultWorkerBehaviorConfig = PendingTaskBasedWorkerProvisioningStrategy.getDefaultWorkerBehaviorConfig(DSuppliers.of(workerConfig), config, "test", mockLogger);
Assert.assertNull(defaultWorkerBehaviorConfig);
Assert.assertEquals(PendingTaskBasedWorkerProvisioningStrategy.ERROR_MESSAGE_MIN_WORKER_ZERO_HINT_UNSET, capturedArgument.getValue());
}
Aggregations