use of org.mifos.platform.questionnaire.matchers.EventSourcesMatcher in project head by mifos.
the class QuestionnaireServiceFacadeTest method testRetrieveEventSources.
@Test
public void testRetrieveEventSources() {
EventSourceDto event1 = makeEvent("Create", "Client", "Create Client");
EventSourceDto event2 = makeEvent("View", "Client", "View Client");
List<EventSourceDto> events = getEvents(event1, event2);
when(questionnaireService.getAllEventSources()).thenReturn(events);
List<EventSourceDto> eventSourceDtos = questionnaireServiceFacade.getAllEventSources();
Assert.assertNotNull(eventSourceDtos);
Assert.assertTrue(eventSourceDtos.size() == 2);
assertThat(eventSourceDtos, new EventSourcesMatcher(asList(event1, event2)));
Mockito.verify(questionnaireService).getAllEventSources();
}
use of org.mifos.platform.questionnaire.matchers.EventSourcesMatcher in project head by mifos.
the class QuestionnaireMapperTest method shouldMapToEventSources.
@Test
public void shouldMapToEventSources() {
List<EventSourceEntity> events = getEventSourceEntities("Create", "Client", "Create Client");
List<EventSourceDto> eventSourceDtos = questionnaireMapper.mapToEventSources(events);
assertThat(eventSourceDtos, is(notNullValue()));
assertThat(eventSourceDtos, new EventSourcesMatcher(asList(getEventSource("Create", "Client", "Create Client"))));
}
use of org.mifos.platform.questionnaire.matchers.EventSourcesMatcher in project head by mifos.
the class QuestionnaireServiceIntegrationTest method shouldRetrieveAllEventSources.
@Test
@Transactional(rollbackFor = DataAccessException.class)
public void shouldRetrieveAllEventSources() {
List<EventSourceDto> eventSourceDtos = questionnaireService.getAllEventSources();
assertNotNull(eventSourceDtos);
assertThat(eventSourceDtos, new EventSourcesMatcher(asList(new EventSourceDto("Create", "Client", "Create Client"), new EventSourceDto("View", "Client", "View Client"), new EventSourceDto("Create", "Group", "Create Group"), new EventSourceDto("Approve", "Loan", "Approve Loan"), new EventSourceDto("Close", "Client", "Close Client"), new EventSourceDto("Create", "Loan", "Create Loan"), new EventSourceDto("View", "Loan", "View Loan"), new EventSourceDto("View", "Group", "View Group"), new EventSourceDto("Create", "Center", "Create Center"), new EventSourceDto("View", "Center", "View Center"), new EventSourceDto("Disburse", "Loan", "Disburse Loan"), new EventSourceDto("Create", "Savings", "Create Savings"), new EventSourceDto("View", "Savings", "View Savings"), new EventSourceDto("Create", "Office", "Create Office"), new EventSourceDto("Create", "Personnel", "Create Personnel"), new EventSourceDto("Close", "Loan", "Close Loan"), new EventSourceDto("Close", "Savings", "Close Savings"))));
}
Aggregations