use of com.vaadin.flow.server.frontend.scanner.ClassFinder.DefaultClassFinder in project flow by vaadin.
the class ScannerThemeTest method should_defaultToLumoTheme_when_noThemeDefinedByExporter.
@Test
public void should_defaultToLumoTheme_when_noThemeDefinedByExporter() throws Exception {
// RootViewWithTheme is added to the list just to make sure exporter
// handles theming default, not the other crawlers
DefaultClassFinder finder = spy(new DefaultClassFinder(new HashSet<>(Arrays.asList(NoThemeExporter.class, RootViewWithTheme.class))));
Mockito.doReturn(Theme4.class).when(finder).loadClass(FrontendDependencies.LUMO);
FrontendDependencies deps = new FrontendDependencies(finder);
assertEquals("Theme4 should have been returned when default theme was selected", Theme4.class, deps.getThemeDefinition().getTheme());
assertTrue("Theme4 should have been visited and JsModule collected", deps.getModules().contains("./theme-4.js"));
}
use of com.vaadin.flow.server.frontend.scanner.ClassFinder.DefaultClassFinder in project flow by vaadin.
the class ScannerThemeTest method should_notAttemptToOverrideTheme_when_noExportersFound.
// flow#5715
@Test
public void should_notAttemptToOverrideTheme_when_noExportersFound() throws ClassNotFoundException {
DefaultClassFinder finder = spy(new DefaultClassFinder(Collections.singleton(RootViewWithTheme.class)));
new FrontendDependencies(finder);
verify(finder, times(0)).loadClass(FrontendDependencies.LUMO);
}
Aggregations