@Test
    public void testChangeUserAndPasswordAttributes() {
        alterTableChangeColumnName(USERNAME, ALT_USER_ATT);
        alterTableChangeColumnName(PASSWORD, ALT_PASS_ATT);
        val dbProfileService = new DbProfileService(ds, DbServer.PASSWORD_ENCODER);
        dbProfileService.setPasswordAttribute(ALT_PASS_ATT);
        dbProfileService.setUsernameAttribute(ALT_USER_ATT);
        val profile = new DbProfile();
        profile.setId(Pac4jConstants.EMPTY_STRING + DB_ID);
        profile.setLinkedId(DB_LINKED_ID);
        profile.addAttribute(USERNAME, DB_USER);
        // create
        dbProfileService.create(profile, DB_PASS);
        // check credentials
        val credentials = new UsernamePasswordCredentials(DB_USER, DB_PASS);
        dbProfileService.validate(null, credentials);
        assertNotNull(credentials.getUserProfile());

        // clean up
        dbProfileService.remove((DbProfile) credentials.getUserProfile());
        alterTableChangeColumnName(ALT_USER_ATT, USERNAME);
        alterTableChangeColumnName(ALT_PASS_ATT, PASSWORD);
    }
Tests the {@link DbProfileService}.

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