@Test
    void verifySuccess() throws Throwable {
        val properties = new QueryJdbcAuthenticationProperties().setSql(SQL).setFieldPassword(PASSWORD_FIELD);
        properties.setName("DbHandler");
        properties.setPrincipalAttributeList(List.of("locations"));
        val q = new QueryDatabaseAuthenticationHandler(properties, null,
            PrincipalFactoryUtils.newPrincipalFactory(), this.dataSource);
        val credential = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "Mellon");
        val result = q.authenticate(credential, mock(Service.class));
        assertNotNull(result);
        assertNotNull(result.getPrincipal());
        assertTrue(result.getPrincipal().getAttributes().containsKey("locations"));
        assertNotNull(SerializationUtils.serialize(result));
    }
This is postgres tests for {@link QueryDatabaseAuthenticationHandler}.

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