citrusframework / citrusframework/citrus
RestTemplate interceptors not in sync with HttpEndpointConfiguration
- Dominant language
- Java
- Stars
- 485
- Forks
- 155
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
**Citrus Version**
2.8.0
**Expected behavior**
CitrusEndpoints.http()..interceptor(myInterceptor).build() should result in HttpEndpointConfiguration's restTemplate's interceptors to contain myInterceptor.
**Actual behavior**
restTemplate calls do not invoke myInterceptor because it's not added to the collection. (was working in citrus-http-2.6.2)
**Test case sample**
> Please, share the test case (as small as possible) which shows the issue
In context have
@Bean(name = "myClient")
public HttpClient myClient(ClientHttpRequestFactory oAuthHttpClientRequestFactory,
OAuthRestClientInterceptor oAuthRestClientInterceptor) {
return CitrusEndpoints
.http()
.client()
.requestUrl(baseUrl)
.requestFactory(oAuthHttpClientRequestFactory)
.interceptor(oAuthRestClientInterceptor)
.build();
}
...
`When sends message `
...
put breakpoint at com.consol.citrus.http.client.HttpEndpointConfiguration#getRestTemplate
evaluate expression: this.restTemplate.interceptors.size() == 0
result is: true / call fails due to lack of Interceptor.
Contributor guide
Assessment
This issue has not been assessed yet.