@Test
    void verifyFailsWithMissingTotalField() {
        val sql = "SELECT count(*) FROM CAS_NAMED_USERS where username=:username AND password=:password";
        val properties = new QueryJdbcAuthenticationProperties().setSql(sql).setFieldPassword("password");
        properties.setName("namedHandler");
        val q = new QueryDatabaseAuthenticationHandler(properties, null, PrincipalFactoryUtils.newPrincipalFactory(), this.dataSource);
        assertThrows(FailedLoginException.class,
            () -> q.authenticate(CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("whatever", "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/NamedQueryDatabaseAuthenticationHandlerTests.java