@Test
    void verifyAuthentication() throws Throwable {
        val response = new MockHttpServletResponse();
        val request = new MockHttpServletRequest();
        request.setRemoteAddr("185.86.151.11");
        request.setLocalAddr("195.88.151.11");
        ClientInfoHolder.setClientInfo(ClientInfo.from(request));
        
        val body = new LinkedMultiValueMap<String, String>();
        body.add(RestHttpRequestCredentialFactory.PARAMETER_USERNAME, "casuser");
        body.add(RestHttpRequestCredentialFactory.PARAMETER_PASSWORD, "Mellon");
        val result = restAuthenticationService.authenticate(body, request, response).get();
        assertEquals("casuser", result.getAuthentication().getPrincipal().getId());
    }
This is {@link DefaultRestAuthenticationServiceTests}.

@author Misagh Moayyed
@since 6.6.0
core/cas-server-core-rest/src/test/java/org/apereo/cas/rest/authentication/DefaultRestAuthenticationServiceTests.java