Search in sources :

Example 11 with MockVaadinContext

use of com.vaadin.flow.server.MockVaadinContext in project flow by vaadin.

the class RouteConfigurationTest method mockRegistry.

private RouteRegistry mockRegistry() {
    RouteRegistry registry = Mockito.mock(RouteRegistry.class);
    VaadinContext context = new MockVaadinContext();
    Mockito.when(registry.getContext()).thenReturn(context);
    return registry;
}
Also used : MockVaadinContext(com.vaadin.flow.server.MockVaadinContext) MockVaadinContext(com.vaadin.flow.server.MockVaadinContext) VaadinContext(com.vaadin.flow.server.VaadinContext) ApplicationRouteRegistry(com.vaadin.flow.server.startup.ApplicationRouteRegistry) RouteRegistry(com.vaadin.flow.server.RouteRegistry) SessionRouteRegistry(com.vaadin.flow.server.SessionRouteRegistry)

Example 12 with MockVaadinContext

use of com.vaadin.flow.server.MockVaadinContext in project flow by vaadin.

the class TaskGenerateFeatureFlagsTest method setUp.

@Before
public void setUp() throws Exception {
    VaadinContext context = new MockVaadinContext();
    ApplicationConfiguration configuration = Mockito.mock(ApplicationConfiguration.class);
    context.setAttribute(ApplicationConfiguration.class, configuration);
    File frontendFolder = temporaryFolder.newFolder(FRONTEND);
    featureFlags = FeatureFlags.get(context);
    taskGenerateFeatureFlags = new TaskGenerateFeatureFlags(frontendFolder, featureFlags);
}
Also used : MockVaadinContext(com.vaadin.flow.server.MockVaadinContext) MockVaadinContext(com.vaadin.flow.server.MockVaadinContext) VaadinContext(com.vaadin.flow.server.VaadinContext) ApplicationConfiguration(com.vaadin.flow.server.startup.ApplicationConfiguration) File(java.io.File) Before(org.junit.Before)

Aggregations

MockVaadinContext (com.vaadin.flow.server.MockVaadinContext)12 MockVaadinServletService (com.vaadin.flow.server.MockVaadinServletService)5 Before (org.junit.Before)5 MockVaadinSession (com.vaadin.flow.server.MockVaadinSession)4 VaadinContext (com.vaadin.flow.server.VaadinContext)4 VaadinService (com.vaadin.flow.server.VaadinService)4 ApplicationConfiguration (com.vaadin.flow.server.startup.ApplicationConfiguration)4 ApplicationRouteRegistry (com.vaadin.flow.server.startup.ApplicationRouteRegistry)4 AlwaysLockedVaadinSession (com.vaadin.tests.util.AlwaysLockedVaadinSession)3 Test (org.junit.Test)3 Component (com.vaadin.flow.component.Component)2 DeploymentConfiguration (com.vaadin.flow.function.DeploymentConfiguration)2 Route (com.vaadin.flow.router.Route)2 RouteConfiguration (com.vaadin.flow.router.RouteConfiguration)2 DefaultDeploymentConfiguration (com.vaadin.flow.server.DefaultDeploymentConfiguration)2 RouteRegistry (com.vaadin.flow.server.RouteRegistry)2 VaadinResponse (com.vaadin.flow.server.VaadinResponse)2 VaadinServletRequest (com.vaadin.flow.server.VaadinServletRequest)2 VaadinServletService (com.vaadin.flow.server.VaadinServletService)2 Properties (java.util.Properties)2