use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method locationNameShouldBeAbleToHaveDotDot.
@Test
public void locationNameShouldBeAbleToHaveDotDot() {
Location location = new Location("..element");
assertEquals("..element", location.getFirstSegment());
location = new Location("el..ement");
assertEquals("el..ement", location.getFirstSegment());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method spaceInLocation.
@Test
public void spaceInLocation() {
Location location = new Location("foo bar");
assertEquals("foo bar", location.getFirstSegment());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method parseLocationWithQueryString_noValue.
@Test
public void parseLocationWithQueryString_noValue() {
Location location = new Location("path?query");
assertEquals("path", location.getPath());
assertEquals(Collections.singletonMap("query", Collections.emptyList()), location.getQueryParameters().getParameters());
assertEquals("path?query", location.getPathWithQueryParameters());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method locationFromSegments.
@Test
public void locationFromSegments() {
Location location = new Location(Arrays.asList("one", "two"));
assertEquals(Arrays.asList("one", "two"), location.getSegments());
assertEquals("one/two", location.getPath());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method locationWithParamsInUrl.
@Test
public void locationWithParamsInUrl() {
String initialPath = "foo/bar/";
QueryParameters queryParams = getQueryParameters();
Location location = new Location(initialPath, queryParams);
assertEquals("foo/bar/", location.getPath());
assertEquals(queryParams.getParameters(), location.getQueryParameters().getParameters());
}
Aggregations