@Test
    void verifyGrantType() throws Throwable {
        val registeredService = addRegisteredService();
        val request = new MockHttpServletRequest();
        request.addHeader("X-" + CasProtocolConstants.PARAMETER_SERVICE, RegisteredServiceTestUtils.CONST_TEST_URL2);
        RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request, new MockHttpServletResponse()));
        val service = strategy.resolveServiceFrom(RegisteredServiceTestUtils.getService("https://example.org?"
            + OAuth20Constants.CLIENT_ID + '=' + registeredService.getClientId() + '&'
            + OAuth20Constants.GRANT_TYPE + '=' + OAuth20GrantTypes.CLIENT_CREDENTIALS.getType()));
        assertNotNull(service);
        assertTrue(service.getAttributes().containsKey(OAuth20Constants.CLIENT_ID));
        assertTrue(service.getAttributes().containsKey(OAuth20Constants.GRANT_TYPE));
        assertEquals(Ordered.HIGHEST_PRECEDENCE, strategy.getOrder());
    }
This is {@link OAuth20AuthenticationServiceSelectionStrategyTests}.

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