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

    ActionsFilter actionsFilter = createMocks(false);
    HttpRequest httpRequest = mock(HttpRequest.class);
    when(httpRequest.getUri()).thenReturn(EXPECTED_URL);
    RequestToPageLoadingEventConverter requestToPageLoadingEventConverter =
            new RequestToPageLoadingEventConverter(BASE_URL, actionsFilter);
    Map<String, String> expected = ImmutableMap.of(EVENT, EXAMPLE_EVENT_NAME);
    Optional<Map<String, String>> actual = requestToPageLoadingEventConverter.convert(httpRequest);
    assertTrue(actual.isPresent());
    assertEquals(expected, actual.get());
}