@Audit(
        action = AuditableActions.REST_API_TICKET_GRANTING_TICKET,
        actionResolverName = AuditActionResolvers.REST_API_TICKET_GRANTING_TICKET_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.REST_API_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER)
    @Override
    @SuppressWarnings("JdkObsolete")
    public ResponseEntity<String> build(final Ticket ticketGrantingTicket, final HttpServletRequest request) throws Throwable {
        val ticketReference = new URI(request.getRequestURL().toString() + '/' + ticketGrantingTicket.getId());
        val headers = new HttpHeaders();
        headers.setLocation(ticketReference);
        val response = getResponse(ticketGrantingTicket, request, ticketReference, headers);
        val entity = new ResponseEntity<>(response, headers, HttpStatus.CREATED);
        LOGGER.debug("Created response entity [{}]", entity);
        return entity;
    }
This is {@link DefaultTicketGrantingTicketResourceEntityResponseFactory}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-rest-api/src/main/java/org/apereo/cas/rest/factory/DefaultTicketGrantingTicketResourceEntityResponseFactory.java