@Test
    public void testAllowAjaxRequests() {
        val context = MockWebContext.create();
        checker.matches(new CallContext(context, new MockSessionStore()), DefaultMatchers.ALLOW_AJAX_REQUESTS,
            new HashMap<>(), new ArrayList<>());
        assertEquals("*", context.getResponseHeaders().get(ACCESS_CONTROL_ALLOW_ORIGIN_HEADER));
        assertEquals("true", context.getResponseHeaders().get(ACCESS_CONTROL_ALLOW_CREDENTIALS_HEADER));
        val methods = context.getResponseHeaders().get(ACCESS_CONTROL_ALLOW_METHODS_HEADER);
        val methodArray = Arrays.stream(methods.split(",")).map(String::trim).toList();
        assertTrue(methodArray.contains(HTTP_METHOD.POST.name()));
        assertTrue(methodArray.contains(HTTP_METHOD.PUT.name()));
        assertTrue(methodArray.contains(HTTP_METHOD.DELETE.name()));
        assertTrue(methodArray.contains(HTTP_METHOD.OPTIONS.name()));
        assertTrue(methodArray.contains(HTTP_METHOD.GET.name()));
    }
Tests {@link DefaultMatchingChecker}.

@author Jerome Leleu
@since 4.0.0
pac4j-core/src/test/java/org/pac4j/core/matching/checker/DefaultMatchingCheckerTests.java