Search in sources :

Example 1 with UpdateJobRetriesResponse

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

the class UpdateJobRetriesTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final UpdateJobRetriesStub stub = new UpdateJobRetriesStub();
    stub.registerWith(brokerClient);
    final int retries = 123;
    final UpdateJobRetriesRequest request = UpdateJobRetriesRequest.newBuilder().setJobKey(stub.getKey()).setRetries(retries).build();
    // when
    final UpdateJobRetriesResponse response = client.updateJobRetries(request);
    // then
    assertThat(response).isNotNull();
    final BrokerUpdateJobRetriesRequest brokerRequest = brokerClient.getSingleBrokerRequest();
    assertThat(brokerRequest.getKey()).isEqualTo(stub.getKey());
    assertThat(brokerRequest.getIntent()).isEqualTo(JobIntent.UPDATE_RETRIES);
    assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.JOB);
    final JobRecord brokerRequestValue = brokerRequest.getRequestWriter();
    assertThat(brokerRequestValue.getRetries()).isEqualTo(retries);
}
Also used : BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) JobRecord(io.camunda.zeebe.protocol.impl.record.value.job.JobRecord) UpdateJobRetriesResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesResponse) UpdateJobRetriesRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesRequest) BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 2 with UpdateJobRetriesResponse

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

the class UpdateJobRetriesTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final UpdateJobRetriesStub stub = new UpdateJobRetriesStub();
    stub.registerWith(brokerClient);
    final int retries = 123;
    final UpdateJobRetriesRequest request = UpdateJobRetriesRequest.newBuilder().setJobKey(stub.getKey()).setRetries(retries).build();
    // when
    final UpdateJobRetriesResponse response = client.updateJobRetries(request);
    // then
    assertThat(response).isNotNull();
    final BrokerUpdateJobRetriesRequest brokerRequest = brokerClient.getSingleBrokerRequest();
    assertThat(brokerRequest.getKey()).isEqualTo(stub.getKey());
    assertThat(brokerRequest.getIntent()).isEqualTo(JobIntent.UPDATE_RETRIES);
    assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.JOB);
    final JobRecord brokerRequestValue = brokerRequest.getRequestWriter();
    assertThat(brokerRequestValue.getRetries()).isEqualTo(retries);
}
Also used : BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) JobRecord(io.camunda.zeebe.protocol.impl.record.value.job.JobRecord) UpdateJobRetriesResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesResponse) UpdateJobRetriesRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesRequest) BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Example 3 with UpdateJobRetriesResponse

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

the class UpdateJobRetriesTest method shouldMapRequestAndResponse.

@Test
public void shouldMapRequestAndResponse() {
    // given
    final UpdateJobRetriesStub stub = new UpdateJobRetriesStub();
    stub.registerWith(brokerClient);
    final int retries = 123;
    final UpdateJobRetriesRequest request = UpdateJobRetriesRequest.newBuilder().setJobKey(stub.getKey()).setRetries(retries).build();
    // when
    final UpdateJobRetriesResponse response = client.updateJobRetries(request);
    // then
    assertThat(response).isNotNull();
    final BrokerUpdateJobRetriesRequest brokerRequest = brokerClient.getSingleBrokerRequest();
    assertThat(brokerRequest.getKey()).isEqualTo(stub.getKey());
    assertThat(brokerRequest.getIntent()).isEqualTo(JobIntent.UPDATE_RETRIES);
    assertThat(brokerRequest.getValueType()).isEqualTo(ValueType.JOB);
    final JobRecord brokerRequestValue = brokerRequest.getRequestWriter();
    assertThat(brokerRequestValue.getRetries()).isEqualTo(retries);
}
Also used : BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) JobRecord(io.camunda.zeebe.protocol.impl.record.value.job.JobRecord) UpdateJobRetriesResponse(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesResponse) UpdateJobRetriesRequest(io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesRequest) BrokerUpdateJobRetriesRequest(io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest) GatewayTest(io.camunda.zeebe.gateway.api.util.GatewayTest) Test(org.junit.Test)

Aggregations

GatewayTest (io.camunda.zeebe.gateway.api.util.GatewayTest)3 BrokerUpdateJobRetriesRequest (io.camunda.zeebe.gateway.impl.broker.request.BrokerUpdateJobRetriesRequest)3 UpdateJobRetriesRequest (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesRequest)3 UpdateJobRetriesResponse (io.camunda.zeebe.gateway.protocol.GatewayOuterClass.UpdateJobRetriesResponse)3 JobRecord (io.camunda.zeebe.protocol.impl.record.value.job.JobRecord)3 Test (org.junit.Test)3