use of io.zeebe.client.event.TaskEvent in project zeebe by zeebe-io.
the class TaskQueueTest method shouldCreateTask.
@Test
public void shouldCreateTask() {
final TaskEvent taskEvent = clientRule.tasks().create(clientRule.getDefaultTopic(), "foo").addCustomHeader("k1", "a").addCustomHeader("k2", "b").payload("{ \"payload\" : 123 }").execute();
assertThat(taskEvent).isNotNull();
final long taskKey = taskEvent.getMetadata().getKey();
assertThat(taskKey).isGreaterThanOrEqualTo(0);
}
use of io.zeebe.client.event.TaskEvent in project zeebe by zeebe-io.
the class TaskQueueTest method testCannotCompleteUnlockedTask.
@Test
@Ignore
public void testCannotCompleteUnlockedTask() {
final TaskEvent task = clientRule.tasks().create(clientRule.getDefaultTopic(), "bar").payload("{}").execute();
thrown.expect(BrokerErrorException.class);
thrown.expectMessage("Task does not exist or is not locked");
clientRule.tasks().complete(task).execute();
}
Aggregations