@Test
public void testAuthenticateRequest() {

    HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
    Http.AuthorityList authorities = new Http.AuthorityList();
    Authority authority = Mockito.mock(Authority.class);
    Mockito.when(authority.getCredSource()).thenReturn(CredSource.REQUEST);
    Principal principal = Mockito.mock(Principal.class);
    Mockito.when(authority.authenticate(ArgumentMatchers.any(HttpServletRequest.class),
            ArgumentMatchers.any())).thenReturn(principal);
    authorities.add(authority);
    assertNotNull(Http.authenticate(httpServletRequest, authorities));
}