Search in sources :

Example 6 with ThemeDefinition

use of com.vaadin.flow.theme.ThemeDefinition in project flow by vaadin.

the class FrontendDependenciesTest method appShellConfigurator_collectedAsEndpoint.

@Test
public void appShellConfigurator_collectedAsEndpoint() throws ClassNotFoundException {
    Mockito.when(classFinder.getSubTypesOf(AppShellConfigurator.class)).thenReturn(Collections.singleton(MyAppShell.class));
    Mockito.when(classFinder.loadClass(FakeLumo.class.getName())).thenReturn((Class) FakeLumo.class);
    FrontendDependencies dependencies = new FrontendDependencies(classFinder, false);
    Assert.assertEquals("UI and AppShell should be found", 2, dependencies.getEndPoints().size());
    AbstractTheme theme = dependencies.getTheme();
    Assert.assertNotNull("Theme not found in endpoint", theme);
    ThemeDefinition themeDefinition = dependencies.getThemeDefinition();
    Assert.assertNotNull("ThemeDefinition is not filled", themeDefinition);
    Assert.assertEquals(FakeLumo.class, themeDefinition.getTheme());
}
Also used : AbstractTheme(com.vaadin.flow.theme.AbstractTheme) ThemeDefinition(com.vaadin.flow.theme.ThemeDefinition) Test(org.junit.Test)

Aggregations

ThemeDefinition (com.vaadin.flow.theme.ThemeDefinition)6 AbstractTheme (com.vaadin.flow.theme.AbstractTheme)4 FeatureFlags (com.vaadin.experimental.FeatureFlags)2 File (java.io.File)2 IOException (java.io.IOException)2 List (java.util.List)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Before (org.junit.Before)2 Component (com.vaadin.flow.component.Component)1 UI (com.vaadin.flow.component.UI)1 WebComponentExporter (com.vaadin.flow.component.WebComponentExporter)1 WebComponentExporterFactory (com.vaadin.flow.component.WebComponentExporterFactory)1 NpmPackage (com.vaadin.flow.component.dependency.NpmPackage)1 AppShellConfigurator (com.vaadin.flow.component.page.AppShellConfigurator)1 ReflectTools (com.vaadin.flow.internal.ReflectTools)1 HasErrorParameter (com.vaadin.flow.router.HasErrorParameter)1 Route (com.vaadin.flow.router.Route)1 TARGET (com.vaadin.flow.server.Constants.TARGET)1 PWA (com.vaadin.flow.server.PWA)1