Загрузка данных


public class SslConfiguration {

    public static RestAssuredConfig getP12Config() {
        return RestAssuredConfig.config()
                .sslConfig(new SSLConfig()
                        .keyStore(
                                AuthConfiguration.CERTIFICATE_PATH,
                                AuthConfiguration.CERTIFICATE_PASSWORD)
                        .keystoreType("PKCS12")
                )
                .redirect(RedirectConfig.redirectConfig()
                        .followRedirects(true)
                        .allowCircularRedirects(true)
                        .maxRedirects(20));
    }
}

CookieStore cookieStore = new BasicCookieStore();

RestAssuredConfig config = RestAssuredConfig.config()
        .httpClient(HttpClientConfig.httpClientConfig()
                .httpClientFactory(() -> HttpClients.custom()
                        .setDefaultCookieStore(cookieStore)
                        .build()));


RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();

Response response = restService.restClient()
    .get(spec -> spec
            .config(sslConfig)
            .log().all(),
        AuthConfiguration.AUTH_URL)
    .toResponse();

response.then().log().all();


System.out.println(response.statusCode());
System.out.println(response.getDetailedCookies());
System.out.println(response.getHeaders());