private UsernamePasswordCredentials getCredential(final MockHttpServletRequest request,
                                                      final String uid, final String password,
                                                      final String clientId) throws Throwable {
        val credentials = new UsernamePasswordCredentials(uid, password);

        val code = defaultOAuthCodeFactory.create(RegisteredServiceTestUtils.getService(),
            RegisteredServiceTestUtils.getAuthentication(),
            new MockTicketGrantingTicket("casuser"),
            new ArrayList<>(),
            StringUtils.EMPTY, StringUtils.EMPTY,
            clientId, new HashMap<>(),
            OAuth20ResponseTypes.CODE, OAuth20GrantTypes.AUTHORIZATION_CODE);
        ticketRegistry.addTicket(code);
        request.addParameter(OAuth20Constants.CODE, code.getId());
        return credentials;
    }
This is {@link OidcJwtAuthenticatorRsaTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/authn/OidcJwtAuthenticatorRsaTests.java