@ParameterizedTest
    @MethodSource("testScenarios")
    void verifyOperation(final String mode) throws Throwable {
        assertTrue(oidcCibaAccessTokenGrantRequestExtractor.requestMustBeAuthenticated());
        assertEquals(OAuth20GrantTypes.CIBA, oidcCibaAccessTokenGrantRequestExtractor.getGrantType());
        assertEquals(OAuth20ResponseTypes.NONE, oidcCibaAccessTokenGrantRequestExtractor.getResponseType());

        val registeredService = getOidcRegisteredService(UUID.randomUUID().toString());
        registeredService.setBackchannelTokenDeliveryMode(mode);
        registeredService.setSupportedGrantTypes(Set.of(OAuth20GrantTypes.CIBA.getType()));
        registeredService.setBackchannelClientNotificationEndpoint("https://localhost:1234");
        servicesManager.save(registeredService);

        val principal = RegisteredServiceTestUtils.getPrincipal(UUID.randomUUID().toString());
        val cibaRequest = newCibaRequest(registeredService, principal);

        val request = new MockHttpServletRequest();
        request.addParameter(OAuth20Constants.CLIENT_ID, registeredService.getClientId());
        request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.CIBA.getType());
        request.addParameter(OidcConstants.AUTH_REQ_ID, cibaRequest.getEncodedId());

        val context = new JEEContext(request, new MockHttpServletResponse());
        val profile = new CommonProfile();
        profile.setClientName(Authenticators.CAS_OAUTH_CLIENT_BASIC_AUTHN);
        profile.setId(registeredService.getClientId());
        profile.addAttribute(OAuth20Constants.CLIENT_ID, registeredService.getClientId());
        val profileManager = new ProfileManager(context, oauthDistributedSessionStore);
        profileManager.save(true, profile, false);

        assertTrue(oidcCibaAccessTokenGrantRequestExtractor.supports(context));
        assertThrows(InvalidCibaRequestException.class, () -> oidcCibaAccessTokenGrantRequestExtractor.extract(context));

        if (mode.equalsIgnoreCase(OidcBackchannelTokenDeliveryModes.POLL.name()) || mode.equalsIgnoreCase(OidcBackchannelTokenDeliveryModes.PING.name())) {
            ticketRegistry.updateTicket(cibaRequest.markTicketReady());
            assertNotNull(oidcCibaAccessTokenGrantRequestExtractor.extract(context));
        }
    }
This is {@link AccessTokenCibaGrantRequestExtractorTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/token/ciba/AccessTokenCibaGrantRequestExtractorTests.java