Polishing contribution

Closes gh-36225
This commit is contained in:
rstoyanchev
2026-02-04 11:36:45 +00:00
parent f2d3da3f32
commit 7c2159fbe9
2 changed files with 30 additions and 26 deletions
@@ -19,6 +19,7 @@ package org.springframework.web.service.invoker;
import org.aopalliance.intercept.MethodInterceptor;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.service.annotation.GetExchange;
@@ -43,19 +44,19 @@ public class HttpServiceProxyFactoryTests {
assertThat(service.execute()).isEqualTo("decorated");
}
@Test
void proxyFactoryCustomizer() {
var mi = (MethodInterceptor) invocation -> "intercepted";
var factory = HttpServiceProxyFactory.builderFor(mock(HttpExchangeAdapter.class))
.proxyCustomizer((fact, serviceType) -> {
fact.addAdvice(0, mi);
}).build();
var interceptor = (MethodInterceptor) invocation -> "intercepted";
var proxyFactory = HttpServiceProxyFactory.builderFor(mock(HttpExchangeAdapter.class))
.proxyFactoryCustomizer((factory, serviceType) -> factory.addAdvice(0, interceptor))
.build();
var service = factory.createClient(Service.class);
assertThat(service.execute()).isEqualTo("intercepted");
String result = proxyFactory.createClient(Service.class).execute();
assertThat(result).isEqualTo("intercepted");
}
private interface Service {
@GetExchange