Based of @vamsi's answer this is the full implementation of what worked for us.
POM
<http.client.version>4.5.3</http.client.version>
<curl.logger.version>1.0.5</curl.logger.version>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${http.client.version}</version>
</dependency>
<dependency>
<groupId>com.github.dzieciou.testing</groupId>
<artifactId>curl-logger</artifactId>
<version>${curl.logger.version}</version>
</dependency>
And
public class Requests {
public String baseUrl;
public RequestSpecification getRequestSpecification(String authorizationToken) {
/** Enables printing request as curl under the terminal as per https://github.com/dzieciou/curl-logger */
Options options = Options.builder()
.printMultiliner()
.updateCurl(curl -> curl
.removeHeader("Host")
.removeHeader("User-Agent")
.removeHeader("Connection"))
.build();
RestAssuredConfig config = CurlLoggingRestAssuredConfigFactory.createConfig(options);
baseUrl = Constants.getEndpoint();
RestAssured.baseURI = baseUrl;
RequestSpecification rq = given()
.config(config)
.contentType(ContentType.JSON)
.contentType("application/json\r\n")
.header("Accept", "application/json").and()
.header("Content-Type", "application/json")
.header("Authorization", authorizationToken)
.when()
.log()
.everything();
return rq;
}
}
Generates this bit on the run terminal:

If you can't see it straight away on your run terminal after triggering your tests, or if needing to log it to the standard system output or to a .log file, creating a logback.xml file under the test/resources folder as per the below may help you.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>mylog.log</file>
<append>true</append>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
</appender>
<logger name="curl" level="DEBUG">
<appender-ref ref="FILE"/>
</logger>
PS: Changing between the system output or .log file is done based on which one you pass as a reference for the "curl" logger appender.
