@Test
    void verifyOperation() throws Throwable {
        val strategy = new JdbcAuthorizationPolicy();
        strategy.setUrl("jdbc:mysql://localhost:3306/mysql?allowPublicKeyRetrieval=true&characterEncoding=UTF-8&useSSL=FALSE");
        strategy.setUsername("root");
        strategy.setPassword("password");
        strategy.setQuery("SELECT authorized FROM policies WHERE uri = :uri AND method = :method AND namespace = :namespace");

        val jdbcTemplate = strategy.buildJdbcTemplate();
        jdbcTemplate.getJdbcOperations().execute("DROP TABLE IF EXISTS policies");
        jdbcTemplate.getJdbcOperations().execute("""
            CREATE TABLE policies (
                id INT AUTO_INCREMENT PRIMARY KEY,
                uri VARCHAR(255)   NOT NULL,
                method VARCHAR(10) NOT NULL,
                namespace VARCHAR(100) NOT NULL,
                authorized BOOLEAN NOT NULL,
                UNIQUE KEY uk_policy (uri, method, namespace)
            );
            """);

        val insertSql = """
            INSERT INTO policies (uri, method, namespace, authorized)
                VALUES (:uri, :method, :namespace, :authorized)
            """;
        val dataSet = List.of(
            new MapSqlParameterSource()
                .addValue("uri", "/api/claims")
                .addValue("method", "PUT")
                .addValue("namespace", "API_CLAIMS")
                .addValue("authorized", true)
        );
        dataSet.forEach(params -> jdbcTemplate.update(insertSql, params));

        val authzRequest = AuthorizationRequest.builder()
            .uri("/api/claims")
            .method("PUT")
            .namespace("API_CLAIMS")
            .build()
            .withPrincipal(RegisteredServiceTestUtils.getPrincipal());

        val resource = authorizableResourceRepository.find(authzRequest).orElseThrow();
        assertTrue(strategy.evaluate(resource, authzRequest).authorized());
    }
This is {@link JdbcAuthorizationPolicyTests}.

@author Misagh Moayyed
@since 7.3.0
support/cas-server-support-heimdall/src/test/java/org/apereo/cas/heimdall/JdbcAuthorizationPolicyTests.java