Search in sources :

Example 1 with TaskEvent

use of org.motechproject.tasks.domain.mds.channel.TaskEvent in project motech by motech.

the class AbstractTaskBundleIT method findActionEventBySubject.

protected ActionEvent findActionEventBySubject(List<ActionEvent> actionEvents, String subject) {
    TaskEvent taskEvent = findTaskEventBySubject(actionEvents, subject);
    assertTrue(taskEvent instanceof ActionEvent);
    return (ActionEvent) taskEvent;
}
Also used : ActionEvent(org.motechproject.tasks.domain.mds.channel.ActionEvent) TaskEvent(org.motechproject.tasks.domain.mds.channel.TaskEvent)

Example 2 with TaskEvent

use of org.motechproject.tasks.domain.mds.channel.TaskEvent in project motech by motech.

the class AbstractTaskBundleIT method findTriggerEventBySubject.

protected TriggerEvent findTriggerEventBySubject(List<TriggerEvent> triggerEvents, String subject) {
    TaskEvent taskEvent = findTaskEventBySubject(triggerEvents, subject);
    assertTrue(taskEvent instanceof TriggerEvent);
    return (TriggerEvent) taskEvent;
}
Also used : TriggerEvent(org.motechproject.tasks.domain.mds.channel.TriggerEvent) TaskEvent(org.motechproject.tasks.domain.mds.channel.TaskEvent)

Example 3 with TaskEvent

use of org.motechproject.tasks.domain.mds.channel.TaskEvent in project motech by motech.

the class TaskServiceImplTest method shouldFindActionForGivenInformation.

@Test
public void shouldFindActionForGivenInformation() throws ActionNotFoundException {
    ActionEvent expected = new ActionEventBuilder().build();
    expected.setSubject(action.getSubject());
    expected.setDisplayName("receive");
    Channel c = new Channel();
    c.setActionTaskEvents(asList(expected));
    when(channelService.getChannel("test-action")).thenReturn(c);
    TaskEvent actual = taskService.getActionEventFor(action);
    assertEquals(expected, actual);
}
Also used : ActionEvent(org.motechproject.tasks.domain.mds.channel.ActionEvent) Channel(org.motechproject.tasks.domain.mds.channel.Channel) TaskEvent(org.motechproject.tasks.domain.mds.channel.TaskEvent) ActionEventBuilder(org.motechproject.tasks.domain.mds.channel.builder.ActionEventBuilder) Test(org.junit.Test)

Aggregations

TaskEvent (org.motechproject.tasks.domain.mds.channel.TaskEvent)3 ActionEvent (org.motechproject.tasks.domain.mds.channel.ActionEvent)2 Test (org.junit.Test)1 Channel (org.motechproject.tasks.domain.mds.channel.Channel)1 TriggerEvent (org.motechproject.tasks.domain.mds.channel.TriggerEvent)1 ActionEventBuilder (org.motechproject.tasks.domain.mds.channel.builder.ActionEventBuilder)1