use of io.camunda.zeebe.test.util.grpc.CloseAwareListener in project zeebe by zeebe-io.
the class TestInterceptor method interceptCall.
@Override
public <ReqT, RespT> Listener<ReqT> interceptCall(final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next) {
final var listener = next.startCall(call, headers);
return new CloseAwareListener<>(listener) {
@Override
public void onMessage(final ReqT message) {
if (message instanceof DeployResourceRequest) {
call.close(Status.PERMISSION_DENIED.augmentDescription(ERROR_MESSAGE), new Metadata());
isClosed = true;
return;
}
super.onMessage(message);
}
};
}
use of io.camunda.zeebe.test.util.grpc.CloseAwareListener in project zeebe by camunda-cloud.
the class TestInterceptor method interceptCall.
@Override
public <ReqT, RespT> Listener<ReqT> interceptCall(final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next) {
final var listener = next.startCall(call, headers);
return new CloseAwareListener<>(listener) {
@Override
public void onMessage(final ReqT message) {
if (message instanceof DeployResourceRequest) {
call.close(Status.PERMISSION_DENIED.augmentDescription(ERROR_MESSAGE), new Metadata());
isClosed = true;
return;
}
super.onMessage(message);
}
};
}
use of io.camunda.zeebe.test.util.grpc.CloseAwareListener in project zeebe by camunda.
the class TestInterceptor method interceptCall.
@Override
public <ReqT, RespT> Listener<ReqT> interceptCall(final ServerCall<ReqT, RespT> call, final Metadata headers, final ServerCallHandler<ReqT, RespT> next) {
final var listener = next.startCall(call, headers);
return new CloseAwareListener<>(listener) {
@Override
public void onMessage(final ReqT message) {
if (message instanceof DeployProcessRequest) {
call.close(Status.PERMISSION_DENIED.augmentDescription(ERROR_MESSAGE), new Metadata());
isClosed = true;
return;
}
super.onMessage(message);
}
};
}
Aggregations