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

    final String consumerId = "consumer";
    subscriptions.subscribe(Arrays.asList(topicName), rebalanceListener);
    subscriptions.needReassignment();
    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    coordinator.ensureCoordinatorReady();
    // join initially, but let coordinator rebalance on sync
    client.prepareResponse(joinGroupFollowerResponse(1, consumerId, "leader", Errors.NONE.code()));
    client.prepareResponse(syncGroupResponse(Collections.<TopicPartition>emptyList(), Errors.UNKNOWN.code()));
    coordinator.ensurePartitionAssignment();
}