protected CasProfile buildCasProfile() throws Throwable {
        val profile = new CasProfile();
        profile.setId(ID);
        val attributes = new HashMap<String, Object>();
        attributes.put(FIRST_NAME_ATTRIBUTE, FIRST_NAME);
        attributes.put(LAST_NAME_ATTRIBUTE, LAST_NAME);
        attributes.put(Authentication.class.getName(), CoreAuthenticationTestUtils.getAuthentication());

        val ticket = new MockTicketGrantingTicket("casuser");
        authorizeController.getConfigurationContext().getTicketRegistry().addTicket(ticket);
        attributes.put(TicketGrantingTicket.class.getName(), ticket.getId());


        profile.addAttributes(attributes);
        return profile;
    }
This class tests the {@link OAuth20AuthorizeEndpointController} class.

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