@Test
public void testAuthorizedInternalServerError() {

    Principal principal = Mockito.mock(Principal.class);
    try {
        Http.authorize(null, principal, "action", "resource", null);
    } catch (ResourceException expected) {
        assertEquals(expected.getCode(), 500);
    }
}