Example usage for org.springframework.security.oauth2.client OAuth2RestTemplate getRequestFactory

List of usage examples for org.springframework.security.oauth2.client OAuth2RestTemplate getRequestFactory

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.client OAuth2RestTemplate getRequestFactory.

Prototype

@Override
public ClientHttpRequestFactory getRequestFactory() 

Source Link

Document

Overridden to expose an InterceptingClientHttpRequestFactory if necessary.

Usage

From source file:com.create.application.configuration.TestConfiguration.java

@Bean
@Lazy/*from w  w  w. ja v a2  s  .  com*/
public OAuth2RestTemplate authenticatedUserRestTemplate(TestRestTemplate testRestTemplate,
        @Qualifier("authenticatedUserResourceDetails") OAuth2ProtectedResourceDetails resourceDetails) {
    final OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(resourceDetails);
    restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory()));
    return restTemplate;
}