use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest in project zeebe by camunda.
the class CancelProcessInstanceCommandImpl method send.
@Override
public ZeebeFuture<CancelProcessInstanceResponse> send() {
final CancelProcessInstanceRequest request = builder.build();
final RetriableClientFutureImpl<CancelProcessInstanceResponse, GatewayOuterClass.CancelProcessInstanceResponse> future = new RetriableClientFutureImpl<>(CancelProcessInstanceResponseImpl::new, retryPredicate, streamObserver -> send(request, streamObserver));
send(request, future);
return future;
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest in project zeebe by camunda.
the class CancelProcessInstanceTest method shouldMapRequestAndResponse.
@Test
public void shouldMapRequestAndResponse() {
// given
final CancelProcessInstanceStub stub = new CancelProcessInstanceStub();
stub.registerWith(brokerClient);
final CancelProcessInstanceRequest request = CancelProcessInstanceRequest.newBuilder().setProcessInstanceKey(123).build();
// when
final CancelProcessInstanceResponse response = client.cancelProcessInstance(request);
// then
assertThat(response).isNotNull();
final BrokerCancelProcessInstanceRequest brokerRequest = brokerClient.getSingleBrokerRequest();
assertThat(brokerRequest.getKey()).isEqualTo(123);
assertThat(brokerRequest.getIntent()).isEqualTo(ProcessInstanceIntent.CANCEL);
assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.PROCESS_INSTANCE);
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest in project zeebe by camunda-cloud.
the class CancelProcessInstanceCommandImpl method send.
@Override
public ZeebeFuture<CancelProcessInstanceResponse> send() {
final CancelProcessInstanceRequest request = builder.build();
final RetriableClientFutureImpl<CancelProcessInstanceResponse, GatewayOuterClass.CancelProcessInstanceResponse> future = new RetriableClientFutureImpl<>(CancelProcessInstanceResponseImpl::new, retryPredicate, streamObserver -> send(request, streamObserver));
send(request, future);
return future;
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest in project zeebe by camunda-cloud.
the class CancelProcessInstanceTest method shouldSendCancelCommand.
@Test
public void shouldSendCancelCommand() {
// when
client.newCancelInstanceCommand(123).send().join();
// then
final CancelProcessInstanceRequest request = gatewayService.getLastRequest();
assertThat(request.getProcessInstanceKey()).isEqualTo(123);
rule.verifyDefaultRequestTimeout();
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest in project zeebe by camunda-cloud.
the class CancelProcessInstanceTest method shouldMapRequestAndResponse.
@Test
public void shouldMapRequestAndResponse() {
// given
final CancelProcessInstanceStub stub = new CancelProcessInstanceStub();
stub.registerWith(brokerClient);
final CancelProcessInstanceRequest request = CancelProcessInstanceRequest.newBuilder().setProcessInstanceKey(123).build();
// when
final CancelProcessInstanceResponse response = client.cancelProcessInstance(request);
// then
assertThat(response).isNotNull();
final BrokerCancelProcessInstanceRequest brokerRequest = brokerClient.getSingleBrokerRequest();
assertThat(brokerRequest.getKey()).isEqualTo(123);
assertThat(brokerRequest.getIntent()).isEqualTo(ProcessInstanceIntent.CANCEL);
assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.PROCESS_INSTANCE);
}
Aggregations