Search in sources :

Example 1 with LoggingRequestInterceptor

use of org.openkilda.testing.tools.LoggingRequestInterceptor in project open-kilda by telstra.

the class DefaultServiceConfig method buildLoggingRestTemplate.

/**
 * Build rest template with enabled logging support.
 */
public static RestTemplate buildLoggingRestTemplate() {
    final RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
    List<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors();
    interceptors.add(new LoggingRequestInterceptor());
    restTemplate.setErrorHandler(new ExtendedErrorHandler());
    return restTemplate;
}
Also used : RestTemplate(org.springframework.web.client.RestTemplate) ExtendedErrorHandler(org.openkilda.testing.tools.ExtendedErrorHandler) HttpComponentsClientHttpRequestFactory(org.springframework.http.client.HttpComponentsClientHttpRequestFactory) LoggingRequestInterceptor(org.openkilda.testing.tools.LoggingRequestInterceptor) ClientHttpRequestInterceptor(org.springframework.http.client.ClientHttpRequestInterceptor) BufferingClientHttpRequestFactory(org.springframework.http.client.BufferingClientHttpRequestFactory)

Aggregations

ExtendedErrorHandler (org.openkilda.testing.tools.ExtendedErrorHandler)1 LoggingRequestInterceptor (org.openkilda.testing.tools.LoggingRequestInterceptor)1 BufferingClientHttpRequestFactory (org.springframework.http.client.BufferingClientHttpRequestFactory)1 ClientHttpRequestInterceptor (org.springframework.http.client.ClientHttpRequestInterceptor)1 HttpComponentsClientHttpRequestFactory (org.springframework.http.client.HttpComponentsClientHttpRequestFactory)1 RestTemplate (org.springframework.web.client.RestTemplate)1