use of io.camunda.zeebe.client.api.response.ActivatedJob in project zeebe by zeebe-io.
the class FailJobTest method shouldFailJob.
@Test
public void shouldFailJob() {
// given
final int newRetries = 23;
final ActivatedJob job = Mockito.mock(ActivatedJob.class);
Mockito.when(job.getKey()).thenReturn(12L);
// when
client.newFailCommand(job).retries(newRetries).send().join();
// then
final FailJobRequest request = gatewayService.getLastRequest();
assertThat(request.getJobKey()).isEqualTo(job.getKey());
assertThat(request.getRetries()).isEqualTo(newRetries);
}
use of io.camunda.zeebe.client.api.response.ActivatedJob in project zeebe by zeebe-io.
the class JobUpdateRetriesTest method shouldUpdateRetries.
@Test
public void shouldUpdateRetries() {
// given
final int newRetries = 23;
final ActivatedJob job = Mockito.mock(ActivatedJob.class);
Mockito.when(job.getKey()).thenReturn(12L);
// when
client.newUpdateRetriesCommand(job).retries(newRetries).send().join();
// then
final UpdateJobRetriesRequest request = gatewayService.getLastRequest();
assertThat(request.getJobKey()).isEqualTo(job.getKey());
assertThat(request.getRetries()).isEqualTo(newRetries);
rule.verifyDefaultRequestTimeout();
}
use of io.camunda.zeebe.client.api.response.ActivatedJob in project zeebe by zeebe-io.
the class ThrowErrorTest method shouldThrowError.
@Test
public void shouldThrowError() {
// given
final String errorCode = "errorCode";
final ActivatedJob job = Mockito.mock(ActivatedJob.class);
Mockito.when(job.getKey()).thenReturn(12L);
// when
client.newThrowErrorCommand(job).errorCode(errorCode).send().join();
// then
final ThrowErrorRequest request = gatewayService.getLastRequest();
assertThat(request.getJobKey()).isEqualTo(job.getKey());
assertThat(request.getErrorCode()).isEqualTo(errorCode);
rule.verifyDefaultRequestTimeout();
}
use of io.camunda.zeebe.client.api.response.ActivatedJob in project zeebe by camunda-cloud.
the class FailJobTest method shouldFailJob.
@Test
public void shouldFailJob() {
// given
final int newRetries = 23;
final ActivatedJob job = Mockito.mock(ActivatedJob.class);
Mockito.when(job.getKey()).thenReturn(12L);
// when
client.newFailCommand(job).retries(newRetries).send().join();
// then
final FailJobRequest request = gatewayService.getLastRequest();
assertThat(request.getJobKey()).isEqualTo(job.getKey());
assertThat(request.getRetries()).isEqualTo(newRetries);
}
use of io.camunda.zeebe.client.api.response.ActivatedJob in project zeebe by camunda-cloud.
the class ThrowErrorTest method shouldThrowError.
@Test
public void shouldThrowError() {
// given
final String errorCode = "errorCode";
final ActivatedJob job = Mockito.mock(ActivatedJob.class);
Mockito.when(job.getKey()).thenReturn(12L);
// when
client.newThrowErrorCommand(job).errorCode(errorCode).send().join();
// then
final ThrowErrorRequest request = gatewayService.getLastRequest();
assertThat(request.getJobKey()).isEqualTo(job.getKey());
assertThat(request.getErrorCode()).isEqualTo(errorCode);
rule.verifyDefaultRequestTimeout();
}
Aggregations