private void registerTicket(final String name, final String clientId) throws Throwable {
        val tgt = new MockTicketGrantingTicket("casuser");
        val token = mock(OAuth20RefreshToken.class);
        when(token.getId()).thenReturn(name);
        val service = RegisteredServiceTestUtils.getService(name);
        when(token.getService()).thenReturn(service);
        when(token.isExpired()).thenReturn(false);
        when(token.getAuthentication()).thenReturn(tgt.getAuthentication());
        when(token.getTicketGrantingTicket()).thenReturn(tgt);
        when(token.getClientId()).thenReturn(clientId);
        when(token.getExpirationPolicy()).thenReturn(NeverExpiresExpirationPolicy.INSTANCE);
        when(token.getCreationTime()).thenReturn(ZonedDateTime.now(Clock.systemUTC()));
        ticketRegistry.addTicket(token);
    }
This is {@link OAuth20RefreshTokenGrantTypeTokenRequestValidatorTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/validator/token/OAuth20RefreshTokenGrantTypeTokenRequestValidatorTests.java