use of org.apache.kafka.connect.storage.StatusBackingStore in project kafka by apache.
the class WorkerTaskTest method stopBeforeStarting.
@Test
public void stopBeforeStarting() {
ConnectorTaskId taskId = new ConnectorTaskId("foo", 0);
WorkerTask workerTask = partialMockBuilder(WorkerTask.class).withConstructor(ConnectorTaskId.class, TaskStatus.Listener.class, TargetState.class, ClassLoader.class, ConnectMetrics.class, RetryWithToleranceOperator.class, Time.class, StatusBackingStore.class).withArgs(taskId, statusListener, TargetState.STARTED, loader, metrics, retryWithToleranceOperator, Time.SYSTEM, statusBackingStore).addMockedMethod("initialize").addMockedMethod("execute").addMockedMethod("close").createStrictMock();
workerTask.initialize(TASK_CONFIG);
EasyMock.expectLastCall();
workerTask.close();
EasyMock.expectLastCall();
replay(workerTask);
workerTask.initialize(TASK_CONFIG);
workerTask.stop();
workerTask.awaitStop(1000L);
// now run should not do anything
workerTask.run();
verify(workerTask);
}
Aggregations