@Test
    void verifyBadQuery() {
        val properties = new QueryJdbcAuthenticationProperties().setSql(SQL.replace("*", "error")).setFieldPassword(PASSWORD_FIELD);
        val handler = new QueryDatabaseAuthenticationHandler(properties, null, PrincipalFactoryUtils.newPrincipalFactory(),
            this.dataSource);
        assertThrows(PreventedException.class,
            () -> handler.authenticate(CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("user0", "psw0"), mock(Service.class)));
    }
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