use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceResponse in project zeebe by zeebe-io.
the class CreateProcessInstanceTest method shouldMapRequestAndResponse.
@Test
public void shouldMapRequestAndResponse() {
// given
final CreateProcessInstanceStub stub = new CreateProcessInstanceStub();
stub.registerWith(brokerClient);
final CreateProcessInstanceRequest request = CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey()).build();
// when
final CreateProcessInstanceResponse response = client.createProcessInstance(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());
final BrokerCreateProcessInstanceRequest brokerRequest = brokerClient.getSingleBrokerRequest();
assertThat(brokerRequest.getIntent()).isEqualTo(ProcessInstanceCreationIntent.CREATE);
assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.PROCESS_INSTANCE_CREATION);
final ProcessInstanceCreationRecord brokerRequestValue = brokerRequest.getRequestWriter();
assertThat(brokerRequestValue.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceResponse in project zeebe by camunda-cloud.
the class CreateProcessInstanceTest method shouldMapRequestAndResponse.
@Test
public void shouldMapRequestAndResponse() {
// given
final CreateProcessInstanceStub stub = new CreateProcessInstanceStub();
stub.registerWith(brokerClient);
final CreateProcessInstanceRequest request = CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey()).build();
// when
final CreateProcessInstanceResponse response = client.createProcessInstance(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());
final BrokerCreateProcessInstanceRequest brokerRequest = brokerClient.getSingleBrokerRequest();
assertThat(brokerRequest.getIntent()).isEqualTo(ProcessInstanceCreationIntent.CREATE);
assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.PROCESS_INSTANCE_CREATION);
final ProcessInstanceCreationRecord brokerRequestValue = brokerRequest.getRequestWriter();
assertThat(brokerRequestValue.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
}
use of io.camunda.zeebe.gateway.protocol.GatewayOuterClass.CreateProcessInstanceResponse in project zeebe by camunda.
the class CreateProcessInstanceTest method shouldMapRequestAndResponse.
@Test
public void shouldMapRequestAndResponse() {
// given
final CreateProcessInstanceStub stub = new CreateProcessInstanceStub();
stub.registerWith(brokerClient);
final CreateProcessInstanceRequest request = CreateProcessInstanceRequest.newBuilder().setProcessDefinitionKey(stub.getProcessDefinitionKey()).build();
// when
final CreateProcessInstanceResponse response = client.createProcessInstance(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());
final BrokerCreateProcessInstanceRequest brokerRequest = brokerClient.getSingleBrokerRequest();
assertThat(brokerRequest.getIntent()).isEqualTo(ProcessInstanceCreationIntent.CREATE);
assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.PROCESS_INSTANCE_CREATION);
final ProcessInstanceCreationRecord brokerRequestValue = brokerRequest.getRequestWriter();
assertThat(brokerRequestValue.getProcessDefinitionKey()).isEqualTo(stub.getProcessDefinitionKey());
}
Aggregations