use of com.vaadin.flow.server.SessionRouteRegistry in project flow by vaadin.
the class RouteConfigurationTest method configurationForSessionRegistry_buildsWithCorrectRegistry.
@Test
public void configurationForSessionRegistry_buildsWithCorrectRegistry() {
SessionRouteRegistry registry = getRegistry(session);
registry.update(() -> {
registry.setRoute("", MyRoute.class, Collections.emptyList());
registry.setRoute("path", Secondary.class, Collections.emptyList());
});
try {
VaadinSession.setCurrent(session);
session.lock();
RouteConfiguration routeConfiguration = RouteConfiguration.forSessionScope();
Assert.assertEquals("After unlock registry should be updated for others to configure with new data", 2, routeConfiguration.getAvailableRoutes().size());
} finally {
session.unlock();
CurrentInstance.clearAll();
}
}
Aggregations