use of com.vaadin.flow.router.QueryParameters in project flow by vaadin.
the class QueryParametersTest method underlyingMapUnmodifiable_simple.
@Test(expected = UnsupportedOperationException.class)
public void underlyingMapUnmodifiable_simple() {
QueryParameters params = QueryParameters.simple(getSimpleInputParameters());
params.getParameters().put("one", Collections.emptyList());
}
use of com.vaadin.flow.router.QueryParameters in project flow by vaadin.
the class QueryParametersTest method emptyParameters.
@Test
public void emptyParameters() {
QueryParameters emptyParams = QueryParameters.empty();
assertEquals(Collections.emptyMap(), emptyParams.getParameters());
}
use of com.vaadin.flow.router.QueryParameters in project flow by vaadin.
the class QueryParametersTest method parameterWithoutValue.
@Test
public void parameterWithoutValue() {
QueryParameters params = new QueryParameters(Collections.singletonMap("foo", Collections.emptyList()));
Assert.assertEquals("foo", params.getQueryString());
params = new QueryParameters(Collections.singletonMap("foo", Arrays.asList(null, "bar")));
Assert.assertEquals("foo&foo=bar", params.getQueryString());
params = new QueryParameters(Collections.singletonMap("foo", Arrays.asList("bar", null)));
Assert.assertEquals("foo=bar&foo", params.getQueryString());
}
use of com.vaadin.flow.router.QueryParameters in project flow by vaadin.
the class QueryParametersTest method complexParametersToQueryString.
@Test
public void complexParametersToQueryString() {
QueryParameters fullParams = QueryParameters.full(getFullInputParameters());
String queryString = fullParams.getQueryString();
assertTrue(queryString.contains("one=1"));
assertTrue(queryString.contains("one=11"));
assertTrue(queryString.contains("two=2"));
assertTrue(queryString.contains("two=22"));
assertTrue(queryString.contains("three=3"));
assertNumberOfOccurences(queryString, 4, "&");
}
use of com.vaadin.flow.router.QueryParameters in project flow by vaadin.
the class QueryParametersTest method emptyParametersToQueryString.
@Test
public void emptyParametersToQueryString() {
QueryParameters emptyParams = QueryParameters.empty();
assertEquals("", emptyParams.getQueryString());
}
Aggregations