Search in sources :

Example 1 with ResolveIncidentRequest

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

the class ResolveIncidentCommandImpl method send.

@Override
public ZeebeFuture<ResolveIncidentResponse> send() {
    final ResolveIncidentRequest request = builder.build();
    final RetriableClientFutureImpl<ResolveIncidentResponse, GatewayOuterClass.ResolveIncidentResponse> future = new RetriableClientFutureImpl<>(ResolveIncidentResponseImpl::new, retryPredicate, streamObserver -> send(request, streamObserver));
    send(request, future);
    return future;
}
Also used : ResolveIncidentRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest) ResolveIncidentResponseImpl(io.camunda.zeebe.client.impl.response.ResolveIncidentResponseImpl) RetriableClientFutureImpl(io.camunda.zeebe.client.impl.RetriableClientFutureImpl) ResolveIncidentResponse(io.camunda.zeebe.client.api.response.ResolveIncidentResponse)

Example 2 with ResolveIncidentRequest

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

the class ResolveIncidentTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final ResolveIncidentStub stub = new ResolveIncidentStub();
    stub.registerWith(brokerClient);
    final ResolveIncidentRequest request = ResolveIncidentRequest.newBuilder().setIncidentKey(stub.getIncidentKey()).build();
    // when
    final ResolveIncidentResponse response = client.resolveIncident(request);
    // then
    assertThat(response).isNotNull();
    final BrokerResolveIncidentRequest brokerRequest = brokerClient.getSingleBrokerRequest();
    assertThat(brokerRequest.getIntent()).isEqualTo(IncidentIntent.RESOLVE);
    assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.INCIDENT);
    assertThat(brokerRequest.getKey()).isEqualTo(stub.getIncidentKey());
}
Also used : ResolveIncidentRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest) BrokerResolveIncidentRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerResolveIncidentRequest) BrokerResolveIncidentRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerResolveIncidentRequest) ResolveIncidentResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentResponse) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 3 with ResolveIncidentRequest

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

the class ResolveIncidentCommandImpl method send.

@Override
public ZeebeFuture<ResolveIncidentResponse> send() {
    final ResolveIncidentRequest request = builder.build();
    final RetriableClientFutureImpl<ResolveIncidentResponse, GatewayOuterClass.ResolveIncidentResponse> future = new RetriableClientFutureImpl<>(ResolveIncidentResponseImpl::new, retryPredicate, streamObserver -> send(request, streamObserver));
    send(request, future);
    return future;
}
Also used : ResolveIncidentRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest) ResolveIncidentResponseImpl(io.camunda.zeebe.client.impl.response.ResolveIncidentResponseImpl) RetriableClientFutureImpl(io.camunda.zeebe.client.impl.RetriableClientFutureImpl) ResolveIncidentResponse(io.camunda.zeebe.client.api.response.ResolveIncidentResponse)

Example 4 with ResolveIncidentRequest

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

the class ResolveIncidentCommandImpl method send.

@Override
public ZeebeFuture<ResolveIncidentResponse> send() {
    final ResolveIncidentRequest request = builder.build();
    final RetriableClientFutureImpl<ResolveIncidentResponse, GatewayOuterClass.ResolveIncidentResponse> future = new RetriableClientFutureImpl<>(ResolveIncidentResponseImpl::new, retryPredicate, streamObserver -> send(request, streamObserver));
    send(request, future);
    return future;
}
Also used : ResolveIncidentRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest) ResolveIncidentResponseImpl(io.camunda.zeebe.client.impl.response.ResolveIncidentResponseImpl) RetriableClientFutureImpl(io.camunda.zeebe.client.impl.RetriableClientFutureImpl) ResolveIncidentResponse(io.camunda.zeebe.client.api.response.ResolveIncidentResponse)

Example 5 with ResolveIncidentRequest

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

the class ResolveIncidentTest method shouldSendCommand.

@Test
public void shouldSendCommand() {
    // when
    client.newResolveIncidentCommand(123).send().join();
    // then
    final ResolveIncidentRequest request = gatewayService.getLastRequest();
    assertThat(request.getIncidentKey()).isEqualTo(123);
    rule.verifyDefaultRequestTimeout();
}
Also used : ResolveIncidentRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest) ClientTest(io.camunda.zeebe.client.util.ClientTest) Test(org.junit.Test)

Aggregations

ResolveIncidentRequest (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentRequest)9 Test (org.junit.Test)6 ResolveIncidentResponse (io.camunda.zeebe.client.api.response.ResolveIncidentResponse)3 RetriableClientFutureImpl (io.camunda.zeebe.client.impl.RetriableClientFutureImpl)3 ResolveIncidentResponseImpl (io.camunda.zeebe.client.impl.response.ResolveIncidentResponseImpl)3 ClientTest (io.camunda.zeebe.client.util.ClientTest)3 GatewayTest (io.camunda.zeebe.gateway.api.util.GatewayTest)3 BrokerResolveIncidentRequest (io.camunda.zeebe.gateway.impl.broker.request.BrokerResolveIncidentRequest)3 ResolveIncidentResponse (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.ResolveIncidentResponse)3