@Test
    void verifyStatusCode4xx() {
        val strategy = new OpenFGAAuthorizationPolicy();
        strategy.setRelation("reader");
        strategy.setStoreId("01GFTZWEZZMAM0NHQQZWE6AN3H");
        strategy.setToken(UUID.randomUUID().toString());

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

        val resource = authorizableResourceRepository.find(authzRequest).orElseThrow();
        try (val webServer = new MockWebServer(HttpStatus.FORBIDDEN)) {
            webServer.start();
            strategy.setApiUrl("http://localhost:%s".formatted(webServer.getPort()));
            assertFalse(strategy.evaluate(resource, authzRequest).authorized());
        }
    }
This is {@link OpenFGAAuthorizationPolicyTests}.

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