@Test(expected = ApiException.class)
public void testInvalidSessionTimeout() {

    subscriptions.subscribe(Arrays.asList(topicName), rebalanceListener);
    subscriptions.needReassignment();
    client.prepareResponse(consumerMetadataResponse(node, Errors.NONE.code()));
    coordinator.ensureCoordinatorReady();
    // coordinator doesn't like the session timeout
    client.prepareResponse(joinGroupFollowerResponse(0, "consumer", "", Errors.INVALID_SESSION_TIMEOUT.code()));
    coordinator.ensurePartitionAssignment();
}