Search in sources :

Example 1 with CancelProcessInstanceResponse

use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse 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);
}
Also used : CancelProcessInstanceRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) CancelProcessInstanceResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 2 with CancelProcessInstanceResponse

use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse 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);
}
Also used : CancelProcessInstanceRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) CancelProcessInstanceResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 3 with CancelProcessInstanceResponse

use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse in project zeebe by zeebe-io.

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);
}
Also used : CancelProcessInstanceRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) BrokerCancelProcessInstanceRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest) CancelProcessInstanceResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Aggregations

GatewayTest (io.camunda.zeebe.gateway.api.util.GatewayTest)3 BrokerCancelProcessInstanceRequest (io.camunda.zeebe.gateway.impl.broker.request.BrokerCancelProcessInstanceRequest)3 CancelProcessInstanceRequest (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceRequest)3 CancelProcessInstanceResponse (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CancelProcessInstanceResponse)3 Test (org.junit.Test)3