RouteDefinitionServiceImpl implements RouteDefinitionService { @Override public boolean isInputRoute(RouteTypeInfo routeTypeInfo) { Assert.notNull(routeTypeInfo, "routeTypeInfo must not be null"); RouteType routeType = findRouteType(routeTypeInfo); return routeType != null && routeType.getName().equals(RouteTypeEnum.INPUT.getName()); }  @Nullable @Override RouteType findRouteType(RouteTypeInfo routeTypeInfo); @Override boolean isInputRoute(RouteTypeInfo routeTypeInfo);  }
@Test public void testIsInputRoute() throws Exception { assertThat(routeDefinitionService.isInputRoute( new RouteTypeInfo(getCamelContext().getRoute("inputTestRouteOne"), null, null, null)), is(true)); assertThat(routeDefinitionService.isInputRoute( new RouteTypeInfo(getCamelContext().getRoute("inputTestRouteTwo"), null, null, null)), is(true)); assertThat(routeDefinitionService.isInputRoute( new RouteTypeInfo(getCamelContext().getRoute("outputTestRouteOne"), null, null, null)), is(false)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, null, getCamelContext().getRouteDefinition("inputTestRouteOne"))), is(true)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, null, getCamelContext().getRouteDefinition("inputTestRouteTwo"))), is(true)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, null, getCamelContext().getRouteDefinition("outputTestRouteOne"))), is(false)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, AbstractBasicRoute.getRouteId(ServiceTestEnum.CUSTOMER, "operation"), null)), is(false)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, AbstractBasicRoute.getExternalRouteId(ExternalSystemTestEnum.CRM, "operation"), null)), is(false)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, AbstractBasicRoute.getOutRouteId(ServiceTestEnum.ACCOUNT, "operation"), null)), is(false)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, AbstractBasicRoute.getInRouteId(ServiceTestEnum.ACCOUNT, "operation"), null)), is(true)); assertThat(routeDefinitionService.isInputRoute(new RouteTypeInfo(null, null, AbstractBasicRoute.getInRouteId(ServiceTestEnum.CUSTOMER, "test"), null)), is(true)); }