use of io.zeebe.test.broker.protocol.clientapi.ExecuteCommandResponse in project zeebe by zeebe-io.
the class TaskUpdateRetriesTest method shouldRejectUpdateRetriesIfTaskLocked.
@Test
public void shouldRejectUpdateRetriesIfTaskLocked() {
// given
client.createTask(TASK_TYPE);
apiRule.openTaskSubscription(TASK_TYPE).await();
final SubscribedEvent subscribedEvent = receiveSingleSubscribedEvent();
final Map<String, Object> event = subscribedEvent.event();
event.put("retries", NEW_RETRIES);
// when
final ExecuteCommandResponse response = client.updateTaskRetries(subscribedEvent.key(), event);
// then
assertThat(response.getEvent()).containsEntry("state", "UPDATE_RETRIES_REJECTED");
}
use of io.zeebe.test.broker.protocol.clientapi.ExecuteCommandResponse in project zeebe by zeebe-io.
the class TaskUpdateRetriesTest method shouldRejectUpdateRetriesIfTaskCompleted.
@Test
public void shouldRejectUpdateRetriesIfTaskCompleted() {
// given
client.createTask(TASK_TYPE);
apiRule.openTaskSubscription(TASK_TYPE).await();
final SubscribedEvent subscribedEvent = receiveSingleSubscribedEvent();
Map<String, Object> event = subscribedEvent.event();
final ExecuteCommandResponse completeResponse = client.completeTask(subscribedEvent.key(), event);
event = completeResponse.getEvent();
event.put("retries", NEW_RETRIES);
// when
final ExecuteCommandResponse response = client.updateTaskRetries(subscribedEvent.key(), event);
// then
assertThat(response.getEvent()).containsEntry("state", "UPDATE_RETRIES_REJECTED");
}
Aggregations