Search in sources :

Example 1 with NotificationRuleDto

use of org.motechproject.admin.web.dto.NotificationRuleDto in project motech by motech.

the class MessageControllerTest method shouldHandleNotificationDto.

@Test
public void shouldHandleNotificationDto() {
    NotificationRule notificationRule1 = mock(NotificationRule.class);
    NotificationRule notificationRule2 = mock(NotificationRule.class);
    List<NotificationRule> ruleList = asList(notificationRule1, notificationRule2);
    NotificationRuleDto notificationRuleDto = new NotificationRuleDto();
    notificationRuleDto.setNotificationRules(ruleList);
    notificationRuleDto.setIdsToRemove(asList("id1", "id2"));
    controller.saveNotificationRules(notificationRuleDto);
    verify(statusMessageService).saveNotificationRules(ruleList);
    verify(statusMessageService).removeNotificationRule("id1");
    verify(statusMessageService).removeNotificationRule("id2");
}
Also used : NotificationRuleDto(org.motechproject.admin.web.dto.NotificationRuleDto) NotificationRule(org.motechproject.admin.domain.NotificationRule) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 NotificationRule (org.motechproject.admin.domain.NotificationRule)1 NotificationRuleDto (org.motechproject.admin.web.dto.NotificationRuleDto)1