@Test
    void verifyOperationToBuild() throws Throwable {
        val profile = new CasProfile();
        profile.setId("casuser");
        profile.addAuthenticationAttribute("clazz", "high");
        profile.addAttribute("cn", "casuser");

        val request = new MockHttpServletRequest();
        request.addParameter(OAuth20Constants.STATE, UUID.randomUUID().toString());
        request.addParameter(OAuth20Constants.NONCE, UUID.randomUUID().toString());
        request.addParameter(OAuth20Constants.ACR_VALUES, "mfa-dummy");
        request.addHeader("X-".concat(CasProtocolConstants.PARAMETER_SERVICE), service.getServiceId());
        val ctx = new JEEContext(request, new MockHttpServletResponse());
        val result = authenticationBuilder.build(profile, service,
            ctx, RegisteredServiceTestUtils.getService());
        assertNotNull(result);
        assertTrue(result.getPrincipal().getAttributes().containsKey("cn"));
        assertTrue(result.getAttributes().containsKey("clazz"));
    }
This is {@link OAuth20DefaultCasAuthenticationBuilderTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/authenticator/OAuth20DefaultCasAuthenticationBuilderTests.java