RouteUtil { public static String getRouteAliasPath(Class<?> component, RouteAlias alias) { if (alias.absolute()) { return alias.value(); } List<String> parentRoutePrefixes = getRoutePrefixes(component, alias.layout(), alias.value()); return parentRoutePrefixes.stream().collect(Collectors.joining("/")); } protected  RouteUtil(); static List<Class<? extends RouterLayout>> getParentLayouts(
            Class<?> component, String path); static String getRoutePath(Class<?> component, Route route); static String getRouteAliasPath(Class<?> component,
            RouteAlias alias); static List<Class<? extends RouterLayout>> getParentLayoutsForNonRouteTarget(
            Class<?> navigationTarget); static Class<? extends RouterLayout> getTopParentLayout(
            final Class<?> component, final String path); static String resolve(Class<?> component, Route route); static void updateRouteRegistry(RouteRegistry registry,
            Set<Class<?>> addedClasses, Set<Class<?>> modifiedClasses,
            Set<Class<?>> deletedClasses);  }
@Test public void absolute_route_alias_should_not_contain_parent_prefix() { String routePath = RouteUtil.getRouteAliasPath(AbsoluteRoute.class, AbsoluteRoute.class.getAnnotation(RouteAlias.class)); Assert.assertEquals("No parent prefix should have been added.", "alias", routePath); }
@Test public void absolute_middle_parent_for_route_alias_should_not_contain_parent_prefix() { String routePath = RouteUtil.getRouteAliasPath(AbsoluteRoute.class, AbsoluteCenterRoute.class.getAnnotation(RouteAlias.class)); Assert.assertEquals("No parent prefix should have been added.", "absolute/alias", routePath); }
@Test public void route_alias_path_should_not_contain_parent_prefix() { String routePath = RouteUtil.getRouteAliasPath( BaseRouteWithParentPrefixAndRouteAlias.class, BaseRouteWithParentPrefixAndRouteAlias.class .getAnnotation(RouteAlias.class)); Assert.assertEquals( "Expected path should only have been parent RoutePrefix", "alias", routePath); routePath = RouteUtil.getRouteAliasPath( RouteWithParentPrefixAndRouteAlias.class, RouteWithParentPrefixAndRouteAlias.class .getAnnotation(RouteAlias.class)); Assert.assertEquals( "Expected path should only have been parent RoutePrefix", "alias", routePath); }
@Test public void route_alias_should_contain_parent_prefix() { String routePath = RouteUtil.getRouteAliasPath( RouteAliasWithParentPrefix.class, RouteAliasWithParentPrefix.class .getAnnotation(RouteAlias.class)); Assert.assertEquals( "Expected path should only have been parent RoutePrefix", "aliasparent/alias", routePath); }