@Test
    void verifyOperation() {
        val request = new MockHttpServletRequest();
        val body = new LinkedMultiValueMap<String, String>();
        body.put("username", List.of("casuser"));
        body.put("password", List.of("Mellon"));
        val factory = new ChainingRestHttpRequestCredentialFactory(new UsernamePasswordRestHttpRequestCredentialFactory());
        assertNotNull(factory.fromRequest(request, body));

        assertTrue(factory.fromAuthentication(request, body,
            CoreAuthenticationTestUtils.getAuthentication(),
            mock(MultifactorAuthenticationProvider.class)).isEmpty());
    }
This is {@link ChainingRestHttpRequestCredentialFactoryTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-rest/src/test/java/org/apereo/cas/rest/factory/ChainingRestHttpRequestCredentialFactoryTests.java