@Test
        void verifyAuthenticationWithGrantTypeRefreshToken() throws Throwable {
            val refreshToken = getRefreshToken(serviceWithoutSecret);
            ticketRegistry.addTicket(refreshToken);

            val credentials = new UsernamePasswordCredentials(serviceWithoutSecret.getClientId(), refreshToken.getId());
            val registeredService = new OAuthRegisteredService();
            registeredService.setClientId(credentials.getUsername());
            registeredService.setName(UUID.randomUUID().toString());
            registeredService.setServiceId(CoreAuthenticationTestUtils.CONST_TEST_URL);
            servicesManager.save(registeredService);

            val request = new MockHttpServletRequest();
            val ctx = new JEEContext(request, new MockHttpServletResponse());

            request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.REFRESH_TOKEN.name());
            request.addParameter(OAuth20Constants.CLIENT_ID, registeredService.getClientId());
            request.addParameter(OAuth20Constants.REFRESH_TOKEN, refreshToken.getId());

            oauthClientAuthenticator.validate(new CallContext(ctx, new JEESessionStore()), credentials);
            assertNull(credentials.getUserProfile());

            request.removeAllParameters();
            request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.REFRESH_TOKEN.name());
            request.addParameter(OAuth20Constants.REFRESH_TOKEN, refreshToken.getId());
            oauthClientAuthenticator.validate(new CallContext(ctx, new JEESessionStore()), credentials);
            assertNotNull(credentials.getUserProfile());

            request.removeAllParameters();
            request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.REFRESH_TOKEN.name());
            request.addParameter(OAuth20Constants.CLIENT_ID, registeredService.getClientId());
            request.addParameter(OAuth20Constants.CLIENT_SECRET, serviceWithoutSecret.getClientSecret());
            request.addParameter(OAuth20Constants.REFRESH_TOKEN, refreshToken.getId());
            oauthClientAuthenticator.validate(new CallContext(ctx, new JEESessionStore()), credentials);
            assertNotNull(credentials.getUserProfile());
        }
This is {@link OAuth20ClientIdClientSecretAuthenticatorTests}.

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