@Test
    void testDefaultConfig() {
        AuthenticationInfo info = realm.getAuthenticationInfo(new UsernamePasswordToken(USERNAME, PASSWORD, localhost));

        assertNotNull(info);
        assertTrue(realm.hasRole(info.getPrincipals(), ROLE));

        Object principal = info.getPrincipals().getPrimaryPrincipal();
        assertTrue(principal instanceof UserIdPrincipal);

        UsernamePrincipal usernamePrincipal = info.getPrincipals().oneByType(UsernamePrincipal.class);
        assertEquals(USERNAME, usernamePrincipal.getUsername());

        UserIdPrincipal userIdPrincipal = info.getPrincipals().oneByType(UserIdPrincipal.class);
        assertEquals(USER_ID, userIdPrincipal.getUserId());

        String stringPrincipal = info.getPrincipals().oneByType(String.class);
        assertEquals(USER_ID + USERNAME, stringPrincipal);
    }
Simple test case for AuthorizingRealm.
<p/>
TODO - this could/should be expanded to be more robust end to end test for the AuthorizingRealm
core/src/test/java/org/apache/shiro/realm/AuthorizingRealmTest.java