use of org.springframework.http.client.Netty4ClientHttpRequestFactory in project paascloud-master by paascloud.
the class OAuth2FeignAutoConfiguration method oAuth2RestTemplate.
/**
* O auth 2 rest template o auth 2 rest template.
*
* @return the o auth 2 rest template
*/
@Bean("paascloudOAuth2RestTemplate")
public OAuth2RestTemplate oAuth2RestTemplate() {
final OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(resourceDetails(), new DefaultOAuth2ClientContext());
oAuth2RestTemplate.setRequestFactory(new Netty4ClientHttpRequestFactory());
return oAuth2RestTemplate;
}
use of org.springframework.http.client.Netty4ClientHttpRequestFactory in project pinpoint by naver.
the class RestTemplateIT method test3.
@Test
public void test3() throws Exception {
RestTemplate restTemplate = new RestTemplate(new Netty4ClientHttpRequestFactory());
String forObject = restTemplate.getForObject(getCallUrl(), String.class);
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.awaitTrace(event("ASYNC", "Asynchronous Invocation"), 20, 3000);
verifier.printCache();
verifier.verifyTrace(event("REST_TEMPLATE", RestTemplate.class.getConstructor()));
verifier.verifyTrace(event("REST_TEMPLATE", "org.springframework.http.client.AbstractAsyncClientHttpRequest.executeAsync()"));
verifier.verifyTrace(event("REST_TEMPLATE", "RestTemplate execAsync Result Invocation"));
verifier.verifyTrace(event("ASYNC", "Asynchronous Invocation"));
verifier.verifyTrace(event("REST_TEMPLATE", "org.springframework.util.concurrent.SettableListenableFuture.set(java.lang.Object)", annotation("http.status.code", 200)));
}
Aggregations