use of com.vaadin.flow.router.RouteConfiguration in project flow by vaadin.
the class RouteRegistryInitializer method configureRoutes.
private void configureRoutes(Set<Class<? extends Component>> routes, ApplicationRouteRegistry routeRegistry) {
RouteConfiguration routeConfiguration = RouteConfiguration.forRegistry(routeRegistry);
routeConfiguration.update(() -> setAnnotatedRoutes(routeConfiguration, routes));
}
use of com.vaadin.flow.router.RouteConfiguration in project flow by vaadin.
the class BootstrapHandlerPushConfigurationTest method assertPushConfigurationForComponent.
private void assertPushConfigurationForComponent(Class<? extends Component> annotatedClazz, Class<? extends PushConnection> pushConnectionType) throws InvalidRouteConfigurationException {
BootstrapHandler bootstrapHandler = new BootstrapHandler();
VaadinResponse response = mock(VaadinResponse.class);
RouteConfiguration routeConfiguration = RouteConfiguration.forRegistry(service.getRouteRegistry());
routeConfiguration.update(() -> {
routeConfiguration.getHandledRegistry().clean();
routeConfiguration.setAnnotatedRoute(annotatedClazz);
});
final BootstrapHandler.BootstrapContext context = bootstrapHandler.createAndInitUI(UI.class, createVaadinRequest(), response, session);
Push pushAnnotation = annotatedClazz.getAnnotation(Push.class);
Assert.assertNotNull("Should have @Push annotated component", pushAnnotation);
PushConfiguration pushConfiguration = context.getUI().getPushConfiguration();
assertPushConfiguration(pushConfiguration, pushAnnotation);
assertThat(context.getUI().getInternals().getPushConnection(), instanceOf(pushConnectionType));
}
Aggregations