use of com.vaadin.flow.router.RouteParam in project flow by vaadin.
the class UITest method navigateWithParameters_afterServerNavigation.
@Test
public void navigateWithParameters_afterServerNavigation() throws InvalidRouteConfigurationException {
UI ui = new UI();
initUI(ui, "", null);
ui.navigate(FooBarParamNavigationTarget.class, new RouteParameters(new RouteParam("fooParam", "flu"), new RouteParam("barParam", "beer")));
assertEquals("foo/flu/beer/bar", ui.getInternals().getActiveViewLocation().getPath());
List<HasElement> chain = ui.getInternals().getActiveRouterTargetsChain();
Assert.assertEquals(2, chain.size());
MatcherAssert.assertThat(chain.get(0), CoreMatchers.instanceOf(FooBarParamNavigationTarget.class));
MatcherAssert.assertThat(chain.get(1), CoreMatchers.instanceOf(FooBarParamParentNavigationTarget.class));
}
Aggregations