@Test
public void testBasicAuthentication()
{

    Predicate<Request> predicate = request -> request.getUri().getPath().startsWith("/private");
    HttpRequestFilter filter = new BasicAuthRequestFilter(predicate, "Aladdin", "open sesame");
    Request publicResourceRequest = createTestRequest("/public");
    assertNull(filter.filterRequest(publicResourceRequest).getHeader(AUTHORIZATION));
    Request privateResourceRequest = createTestRequest("/private");
    assertEquals(filter.filterRequest(privateResourceRequest).getHeader(AUTHORIZATION), "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
}