use of org.onebusaway.enterprise.webapp.actions.m.model.RouteResult in project onebusaway-application-modules by camsys.
the class SearchResultFactoryImplTest method testGetRouteResultServiceAlertWithDescriptionsAndSummaries.
@Test
public void testGetRouteResultServiceAlertWithDescriptionsAndSummaries() {
RouteResult result = runGetRouteResult(createServiceAlerts(new String[] { TEST_DESCRIPTION }, new String[] { TEST_SUMMARY }));
Set<String> alerts = result.getServiceAlerts();
assertEquals(1, alerts.size());
assertEquals(TEST_DESCRIPTION, alerts.toArray()[0]);
assertEquals("name not expected", ROUTE_ID, result.getId());
}
use of org.onebusaway.enterprise.webapp.actions.m.model.RouteResult in project onebusaway-application-modules by camsys.
the class SearchResultFactoryImplTest method runGetRouteResult.
private RouteResult runGetRouteResult(List<ServiceAlertBean> serviceAlerts) {
StopsForRouteBean stopsForRouteBean = mock(StopsForRouteBean.class);
when(_transitDataService.getStopsForRoute(anyString())).thenReturn(stopsForRouteBean);
when(_realtimeService.getServiceAlertsForRoute(ROUTE_ID)).thenReturn(serviceAlerts);
SearchResultFactoryImpl srf = new SearchResultFactoryImpl(_transitDataService, _realtimeService, _configurationService);
RouteResult result = (RouteResult) srf.getRouteResult(createRouteBean());
return result;
}
use of org.onebusaway.enterprise.webapp.actions.m.model.RouteResult in project onebusaway-application-modules by camsys.
the class SearchResultFactoryImplTest method testGetRouteResultServiceAlertWithNoDescriptionsOrSummaries.
// getRouteResult tests
@Test
public void testGetRouteResultServiceAlertWithNoDescriptionsOrSummaries() {
RouteResult result = runGetRouteResult(createServiceAlerts(new String[] {}, new String[] {}));
Set<String> alerts = result.getServiceAlerts();
assertEquals(1, alerts.size());
assertEquals("(no description)", alerts.toArray()[0]);
assertEquals("name not expected", ROUTE_ID, result.getId());
}
Aggregations