@Test
    public void testGoodUsernameAttribute() {
        val credentials =  login(GOOD_USERNAME, PASSWORD, FIRSTNAME);

        val profile = credentials.getUserProfile();
        assertNotNull(profile);
        assertTrue(profile instanceof MongoProfile);
        UserProfile dbProfile = (MongoProfile) profile;
        assertEquals(GOOD_USERNAME, dbProfile.getId());
        assertEquals(FIRSTNAME_VALUE, dbProfile.getAttribute(FIRSTNAME));
    }
Tests the {@link MongoProfileService}.

@author Jerome Leleu
@since 1.8.0
pac4j-mongo/src/test/java/org/pac4j/mongo/profile/service/MongoProfileServiceIT.java