@Test(expected = KafkaException.class)
public void testCommitOffsetSyncCallbackWithNonRetriableException() {

    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    coordinator.ensureCoordinatorReady();
    // sync commit with invalid partitions should throw if we have no callback
    client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.UNKNOWN.code())), false);
    coordinator.commitOffsetsSync(Collections.singletonMap(tp, new OffsetAndMetadata(100L)));
}