Search in sources :

Example 1 with CreateProcessInstanceWithResultResponse

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

the class CreateProcessInstanceWithResultTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final CreateProcessInstanceWithResultStub stub = new CreateProcessInstanceWithResultStub();
    stub.registerWith(brokerClient);
    final CreateProcessInstanceWithResultRequest request = CreateProcessInstanceWithResultRequest.newBuilder().setRequest(CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey())).build();
    // when
    final CreateProcessInstanceWithResultResponse response = client.createProcessInstanceWithResult(request);
    // then
    assertThat(response.getBpmnProcessId()).isEqualTo(stub.getProcessId());
    assertThat(response.getVersion()).isEqualTo(stub.getProcessVersion());
    assertThat(response.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
    assertThat(response.getProcessInstanceKey()).isEqualTo(stub.getProcessInstanceKey());
}
Also used : CreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultRequest) BrokerCreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCreateProcessInstanceWithResultRequest) CreateProcessInstanceWithResultResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 2 with CreateProcessInstanceWithResultResponse

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

the class CreateProcessInstanceWithResultTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final CreateProcessInstanceWithResultStub stub = new CreateProcessInstanceWithResultStub();
    stub.registerWith(brokerClient);
    final CreateProcessInstanceWithResultRequest request = CreateProcessInstanceWithResultRequest.newBuilder().setRequest(CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey())).build();
    // when
    final CreateProcessInstanceWithResultResponse response = client.createProcessInstanceWithResult(request);
    // then
    assertThat(response.getBpmnProcessId()).isEqualTo(stub.getProcessId());
    assertThat(response.getVersion()).isEqualTo(stub.getProcessVersion());
    assertThat(response.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
    assertThat(response.getProcessInstanceKey()).isEqualTo(stub.getProcessInstanceKey());
}
Also used : CreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultRequest) BrokerCreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCreateProcessInstanceWithResultRequest) CreateProcessInstanceWithResultResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 3 with CreateProcessInstanceWithResultResponse

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

the class CreateProcessInstanceWithResultTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final CreateProcessInstanceWithResultStub stub = new CreateProcessInstanceWithResultStub();
    stub.registerWith(brokerClient);
    final CreateProcessInstanceWithResultRequest request = CreateProcessInstanceWithResultRequest.newBuilder().setRequest(CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey())).build();
    // when
    final CreateProcessInstanceWithResultResponse response = client.createProcessInstanceWithResult(request);
    // then
    assertThat(response.getBpmnProcessId()).isEqualTo(stub.getProcessId());
    assertThat(response.getVersion()).isEqualTo(stub.getProcessVersion());
    assertThat(response.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
    assertThat(response.getProcessInstanceKey()).isEqualTo(stub.getProcessInstanceKey());
}
Also used : CreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultRequest) BrokerCreateProcessInstanceWithResultRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerCreateProcessInstanceWithResultRequest) CreateProcessInstanceWithResultResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Aggregations

GatewayTest (io.camunda.zeebe.gateway.api.util.GatewayTest)3 BrokerCreateProcessInstanceWithResultRequest (io.camunda.zeebe.gateway.impl.broker.request.BrokerCreateProcessInstanceWithResultRequest)3 CreateProcessInstanceWithResultRequest (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultRequest)3 CreateProcessInstanceWithResultResponse (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceWithResultResponse)3 Test (org.junit.Test)3