RouteTypeInRouteIdResolver implements RouteTypeResolver { @Nullable @Override public RouteType findRouteType(RouteTypeInfo routeTypeInfo) { Assert.notNull(routeTypeInfo, "routeTypeInfo must not be null"); String routeId = routeTypeInfo.getRouteId(); if (StringUtils.isBlank(routeId) && routeTypeInfo.getRouteDefinition() != null) { routeId = routeTypeInfo.getRouteDefinition().getId(); } if (StringUtils.isBlank(routeId) && routeTypeInfo.getRoute() != null) { routeId = routeTypeInfo.getRoute().getId(); } RouteType result = null; if (!StringUtils.isBlank(routeId) && routeId.matches(ROUTE_ID_IN_REG_EXP)) { result = RouteTypeEnum.INPUT; } return result; }  @Nullable @Override RouteType findRouteType(RouteTypeInfo routeTypeInfo); static final int ORDER; }
@Test public void testFindRouteTypeForRoute() { assertThat(routeTypeInRouteIdResolver.findRouteType(new RouteTypeInfo(null, null, AbstractBasicRoute.getRouteId(ServiceTestEnum.CUSTOMER, "operation"), null)), nullValue()); assertThat(routeTypeInRouteIdResolver.findRouteType(new RouteTypeInfo(null, null, AbstractBasicRoute.getExternalRouteId(ExternalSystemTestEnum.CRM, "operation"), null)), nullValue()); assertThat(routeTypeInRouteIdResolver.findRouteType(new RouteTypeInfo(null, null, AbstractBasicRoute.getOutRouteId(ServiceTestEnum.ACCOUNT, "operation"), null)), nullValue()); assertThat(routeTypeInRouteIdResolver.findRouteType(new RouteTypeInfo(null, null, AbstractBasicRoute.getInRouteId(ServiceTestEnum.ACCOUNT, "operation"), null)), is(RouteTypeEnum.INPUT)); assertThat(routeTypeInRouteIdResolver.findRouteType(new RouteTypeInfo(null, null, AbstractBasicRoute.getInRouteId(ServiceTestEnum.CUSTOMER, "test"), null)), is(RouteTypeEnum.INPUT)); }