RouteBeanServiceImpl implements RouteBeanService { @Cacheable public RouteBean getRouteForId(AgencyAndId id) { RouteCollectionNarrative rc = _narrativeService.getRouteCollectionForId(id); if (rc == null) return null; return getRouteBeanForRouteCollection(id, rc); }  @Autowired void setTransitGraphDao(TransitGraphDao transitGraphDao); @Autowired void setNarrativeService(NarrativeService narrativeService); @Autowired void setAgencyBeanService(AgencyBeanService agencyBeanService); @Autowired void setStopBeanService(StopBeanService stopBeanService); @Autowired void setShapeBeanService(ShapeBeanService shapeBeanService); @Autowired void setRouteService(RouteService routeService); @Autowired void setStopSequencesLibrary(StopSequencesService service); @Autowired void setStopSequencesBlocksService(
      StopSequenceCollectionService stopSequenceBlocksService); @Autowired void setBlockIndexService(BlockIndexService blockIndexService); @Autowired void setCalendarService(CalendarService calendarService); @Autowired void setExtCalendarService(ExtendedCalendarService extCalendarService); @Cacheable RouteBean getRouteForId(AgencyAndId id); @Cacheable StopsForRouteBean getStopsForRoute(AgencyAndId routeId); @Cacheable StopsForRouteBean getStopsForRouteForServiceDate(AgencyAndId routeId, ServiceDate serviceDate);  }
@Test public void testGetRouteForId() { AgencyAndId routeId = new AgencyAndId("1", "route"); RouteCollectionNarrative.Builder routeBuilder = RouteCollectionNarrative.builder(); routeBuilder.setColor("blue"); routeBuilder.setDescription("route desc"); routeBuilder.setLongName("route long name"); routeBuilder.setShortName("route short name"); routeBuilder.setTextColor("red"); routeBuilder.setType(3); routeBuilder.setUrl("http: RouteCollectionNarrative route = routeBuilder.create(); AgencyBean agency = new AgencyBean(); Mockito.when(_agencyBeanService.getAgencyForId("1")).thenReturn(agency); Mockito.when(_narrativeService.getRouteCollectionForId(routeId)).thenReturn( route); RouteBean bean = _service.getRouteForId(routeId); assertEquals(route.getColor(), bean.getColor()); assertEquals(route.getDescription(), bean.getDescription()); assertEquals(AgencyAndIdLibrary.convertToString(routeId), bean.getId()); assertEquals(route.getLongName(), bean.getLongName()); assertEquals(route.getShortName(), bean.getShortName()); assertEquals(route.getTextColor(), bean.getTextColor()); assertEquals(route.getType(), bean.getType()); assertEquals(route.getUrl(), bean.getUrl()); }