@Test
public void testAuthorizedUserUserInvalidCredentials() {

    HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
    Authorizer authorizer = Mockito.mock(Authorizer.class);
    Http.AuthorityList authorities = new Http.AuthorityList();
    try {
        Http.authorizedUser(httpServletRequest, authorities, authorizer, "action", null, null);
    } catch (ResourceException expected) {
        assertEquals(expected.getCode(), 401);
    }
}