@Test
public void testCommitOffsetSyncNotCoordinator() {

    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    coordinator.ensureCoordinatorReady();
    // sync commit with coordinator disconnected (should connect, get metadata, and then submit the commit request)
    client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.NOT_COORDINATOR_FOR_GROUP.code())));
    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.NONE.code())));
    coordinator.commitOffsetsSync(Collections.singletonMap(tp, new OffsetAndMetadata(100L)));
}