@Test
public void connectorStatus() {

    Worker worker = null;
    String workerId = "workerId";
    String connector = "connector";
    int generation = 5;
    ConnectorTaskId taskId = new ConnectorTaskId(connector, 0);
    ConfigBackingStore configStore = strictMock(ConfigBackingStore.class);
    StatusBackingStore statusStore = strictMock(StatusBackingStore.class);
    AbstractHerder herder = partialMockBuilder(AbstractHerder.class)
            .withConstructor(Worker.class, String.class, StatusBackingStore.class, ConfigBackingStore.class)
            .withArgs(worker, workerId, statusStore, configStore)
            .addMockedMethod("generation")
            .createMock();
    EasyMock.expect(herder.generation()).andStubReturn(generation);
    EasyMock.expect(statusStore.get(connector))
            .andReturn(new ConnectorStatus(connector, AbstractStatus.State.RUNNING, workerId, generation));
    EasyMock.expect(statusStore.getAll(connector))
            .andReturn(Collections.singletonList(
                    new TaskStatus(taskId, AbstractStatus.State.UNASSIGNED, workerId, generation)));
    replayAll();
    ConnectorStateInfo state = herder.connectorStatus(connector);
    assertEquals(connector, state.name());
    assertEquals("RUNNING", state.connector().state());
    assertEquals(1, state.tasks().size());
    assertEquals(workerId, state.connector().workerId());
    ConnectorStateInfo.TaskState taskState = state.tasks().get(0);
    assertEquals(0, taskState.id());
    assertEquals("UNASSIGNED", taskState.state());
    assertEquals(workerId, taskState.workerId());
    verifyAll();
}