@Test
    void verifySuccess() throws Throwable {
        val properties = new QueryJdbcAuthenticationProperties().setSql(SQL).setFieldPassword(PASSWORD_FIELD);
        properties.setPrincipalAttributeList(List.of("phone:phoneNumber"));
        val handler = new QueryDatabaseAuthenticationHandler(properties, null, PrincipalFactoryUtils.newPrincipalFactory(), dataSource);
        val result = handler.authenticate(
            CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("user3", "psw3"), mock(Service.class));
        assertNotNull(result);
        assertNotNull(result.getPrincipal());
        assertTrue(result.getPrincipal().getAttributes().containsKey("phoneNumber"));
    }
This is tests for {@link QueryDatabaseAuthenticationHandler}.

@author Misagh Moayyed
@since 4.0.0
support/cas-server-support-jdbc-authentication/src/test/java/org/apereo/cas/jdbc/QueryDatabaseAuthenticationHandlerTests.java