@Test
    void verifyRenewingRefreshToken() throws Throwable {
        val service = addRegisteredService();
        service.setGenerateRefreshToken(true);
        service.setRenewRefreshToken(true);

        val result = assertClientOK(service, true);

        val at = ticketRegistry.getTicket(result.getLeft(), OAuth20AccessToken.class);
        assertNotNull(at);
        assertNotNull(at.getTicketGrantingTicket());

        val rt = ticketRegistry.getTicket(result.getRight(), OAuth20RefreshToken.class);
        assertNotNull(rt);

        val result2 = assertRefreshTokenOk(service, rt, createPrincipal());
        assertNotNull(result2.getLeft());
        assertNotNull(result2.getRight());

        val rt2 = result2.getRight();
        assertNotEquals(rt.getId(), rt2.getId());

        val oldRt = ticketRegistry.getTicket(result.getRight(), ticket -> true);
        assertNull(oldRt);
    }
This class tests the {@link OAuth20AccessTokenEndpointController} class.

@author Jerome Leleu
@since 3.5.2
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/OAuth20RefreshTokenTests.java