use of org.apache.kafka.common.requests.HeartbeatRequest in project kafka by apache.
the class AbstractCoordinatorTest method prepareFirstHeartbeat.
private AtomicBoolean prepareFirstHeartbeat() {
final AtomicBoolean heartbeatReceived = new AtomicBoolean(false);
mockClient.prepareResponse(new MockClient.RequestMatcher() {
@Override
public boolean matches(AbstractRequest body) {
boolean isHeartbeatRequest = body instanceof HeartbeatRequest;
if (isHeartbeatRequest)
heartbeatReceived.set(true);
return isHeartbeatRequest;
}
}, heartbeatResponse(Errors.UNKNOWN));
return heartbeatReceived;
}
Aggregations