Search in sources :

Example 1 with UserTaskInstanceEventBody

use of io.automatiko.engine.services.event.impl.UserTaskInstanceEventBody in project automatiko-engine by automatiko-io.

the class PublishEventTest method assertUserTaskInstanceEvent.

protected UserTaskInstanceEventBody assertUserTaskInstanceEvent(DataEvent<?> event, String taskName, String taskDescription, String taskPriority, String taskState, String processId) {
    assertThat(event).isInstanceOf(UserTaskInstanceDataEvent.class);
    UserTaskInstanceEventBody body = ((UserTaskInstanceDataEvent) event).getData();
    assertThat(body).isNotNull();
    assertThat(body.getId()).isNotNull();
    assertThat(body.getTaskName()).isEqualTo(taskName);
    assertThat(body.getTaskDescription()).isEqualTo(taskDescription);
    assertThat(body.getTaskPriority()).isEqualTo(taskPriority);
    assertThat(body.getStartDate()).isNotNull();
    assertThat(body.getState()).isEqualTo(taskState);
    if (taskState.equals("Completed")) {
        assertThat(body.getCompleteDate()).isNotNull();
    } else {
        assertThat(body.getCompleteDate()).isNull();
    }
    assertThat(event.getSource()).isEqualTo("http://myhost/" + processId);
    assertThat(event.getTime()).doesNotContain("[");
    return body;
}
Also used : UserTaskInstanceEventBody(io.automatiko.engine.services.event.impl.UserTaskInstanceEventBody) UserTaskInstanceDataEvent(io.automatiko.engine.services.event.UserTaskInstanceDataEvent)

Aggregations

UserTaskInstanceDataEvent (io.automatiko.engine.services.event.UserTaskInstanceDataEvent)1 UserTaskInstanceEventBody (io.automatiko.engine.services.event.impl.UserTaskInstanceEventBody)1