@Test(expected = OffsetMetadataTooLarge.class)
public void testCommitOffsetMetadataTooLarge() {

    // since offset metadata is provided by the user, we have to propagate the exception so they can handle it
    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    coordinator.ensureCoordinatorReady();
    client.prepareResponse(offsetCommitResponse(Collections.singletonMap(tp, Errors.OFFSET_METADATA_TOO_LARGE.code())));
    coordinator.commitOffsetsSync(Collections.singletonMap(tp, new OffsetAndMetadata(100L, "metadata")));
}