protected OAuth20Code createOAuthCode() throws Throwable {
        val builder = mock(ExpirationPolicyBuilder.class);
        when(builder.buildTicketExpirationPolicy()).thenReturn(NeverExpiresExpirationPolicy.INSTANCE);

        return new OAuth20DefaultOAuthCodeFactory(new DefaultUniqueTicketIdGenerator(), builder,
            servicesManager, CipherExecutor.noOpOfStringToString(), descendantTicketsTrackingPolicy)
            .create(RegisteredServiceTestUtils.getService(),
                RegisteredServiceTestUtils.getAuthentication(), new MockTicketGrantingTicket("casuser"),
                CollectionUtils.wrapSet("1", "2"), "code-challenge",
                "code-challenge-method", "clientId1234567", new HashMap<>(),
                OAuth20ResponseTypes.CODE, OAuth20GrantTypes.AUTHORIZATION_CODE);
    }
This is {@link BaseOAuth20ExpirationPolicyTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/ticket/BaseOAuth20ExpirationPolicyTests.java