@Test
public void send() {

    client.prepareResponse(heartbeatResponse(Errors.NONE.code()));
    RequestFuture<ClientResponse> future = consumerClient.send(node, ApiKeys.METADATA, heartbeatRequest());
    assertEquals(1, consumerClient.pendingRequestCount());
    assertEquals(1, consumerClient.pendingRequestCount(node));
    assertFalse(future.isDone());
    consumerClient.poll(future);
    assertTrue(future.isDone());
    assertTrue(future.succeeded());
    ClientResponse clientResponse = future.value();
    HeartbeatResponse response = new HeartbeatResponse(clientResponse.responseBody());
    assertEquals(Errors.NONE.code(), response.errorCode());
}