@Test
    public void testExtractionFromRequestBody() {
        val context = MockWebContext.create()
            .setRequestMethod("post")
            .addRequestParameter("username", "pac4j")
            .addRequestParameter("password", "pac4j");
        val extractor = new FormExtractor("username", "password");
        extractor.setExtractionMode(FormExtractor.ExtractionMode.REQUEST_BODY);
        assertTrue(extractor.extract(new CallContext(context, null)).isPresent());
    }
This is {@link FormExtractorTests}.

@author Misagh Moayyed
@since 6.0.0
pac4j-core/src/test/java/org/pac4j/core/credentials/extractor/FormExtractorTests.java