FrontendDependencies extends AbstractDependenciesScanner { @Override public List<String> getModules() { LinkedHashSet<String> all = new LinkedHashSet<>(); for (EndPointData data : endPoints.values()) { all.addAll(data.getThemeModules()); } for (EndPointData data : endPoints.values()) { all.addAll(data.getModules()); } return new ArrayList<>(all); } FrontendDependencies(ClassFinder finder);  FrontendDependencies(ClassFinder finder,
            boolean generateEmbeddableWebComponents); @Override Map<String, String> getPackages(); @Override List<String> getModules(); @Override Set<String> getScripts(); @Override Set<CssData> getCss(); @Override Set<String> getClasses(); Collection<EndPointData> getEndPoints(); @Override ThemeDefinition getThemeDefinition(); @Override AbstractTheme getTheme(); @Override String toString();  }
@Test public void annotationsInRouterLayoutWontBeFlaggedAsBelongingToTheme() { Mockito.when(classFinder.getAnnotatedClasses(Route.class)).thenReturn( Collections.singleton(RouteComponentWithLayout.class)); FrontendDependencies dependencies = new FrontendDependencies( classFinder, false); List<String> expectedOrder = Arrays.asList("theme-foo.js", "foo.js"); Assert.assertThat("Theme's annotations should come first", dependencies.getModules(), is(expectedOrder)); }
@Test public void extractsAndScansClassesFromMethodReferences() { Mockito.when(classFinder.getAnnotatedClasses(Route.class)).thenReturn( Collections.singleton(RouteComponentWithMethodReference.class)); FrontendDependencies dependencies = new FrontendDependencies( classFinder, false); List<String> modules = dependencies.getModules(); Assert.assertEquals(3, modules.size()); Assert.assertTrue(modules.contains("foo.js")); Assert.assertTrue(modules.contains("bar.js")); Assert.assertTrue(modules.contains("baz.js")); }