@Test
public void testRestartTask() throws Exception {

    ConnectorTaskId taskId = new ConnectorTaskId(CONNECTOR_NAME, 0);
    expectAdd(CONNECTOR_NAME, BogusSourceConnector.class, BogusSourceTask.class, false);
    worker.stopAndAwaitTask(taskId);
    EasyMock.expectLastCall();
    Map<String, String> generatedTaskProps = taskConfig(BogusSourceTask.class, false);
    worker.startTask(taskId, new TaskConfig(generatedTaskProps), herder, TargetState.STARTED);
    EasyMock.expectLastCall();
    PowerMock.replayAll();
    herder.putConnectorConfig(CONNECTOR_NAME, connectorConfig(CONNECTOR_NAME, BogusSourceConnector.class, false), false, createCallback);
    FutureCallback<Void> cb = new FutureCallback<>();
    herder.restartTask(taskId, cb);
    cb.get(1000L, TimeUnit.MILLISECONDS);
    PowerMock.verifyAll();
}