@Test
public void canSplitQuery() throws MalformedURLException, UnsupportedEncodingException {

    URL url = new URL("http://www.tenniskafe.com/query?key1=value1&key2=value2");
    HttpRequest httpRequest = mock(HttpRequest.class);
    when(httpRequest.getUri()).thenReturn(url.toString());
    SplitQueryStringOfRequest splitQueryStringOfRequest = new SplitQueryStringOfRequest();
    Optional<Map<String, String>> parametersOptional = splitQueryStringOfRequest.convert(httpRequest);
    assertTrue(parametersOptional.isPresent());
    Map<String, String> parameters = parametersOptional.get();
    assertTrue(parameters.containsKey("key1"));
    assertEquals("value1", parameters.get("key1"));
    assertTrue(parameters.containsKey("key2"));
    assertEquals("value2", parameters.get("key2"));
}