Add Builder to RSocketServiceProxyFactory

RSocketServiceProxyFactory now support programmatic initialization
through a builder, while bean-style initialization is deprecated.

Closes gh-29296
This commit is contained in:
rstoyanchev
2022-10-19 14:36:45 +01:00
parent bd59c7a691
commit d4f7484252
5 changed files with 360 additions and 98 deletions

View File

@@ -75,9 +75,7 @@ class RSocketServiceIntegrationTests {
.rsocketStrategies(context.getBean(RSocketStrategies.class))
.tcp("localhost", 7000);
RSocketServiceProxyFactory proxyFactory = new RSocketServiceProxyFactory(requester);
proxyFactory.afterPropertiesSet();
RSocketServiceProxyFactory proxyFactory = RSocketServiceProxyFactory.builder(requester).build();
serviceProxy = proxyFactory.createClient(Service.class);
context.close();

View File

@@ -47,11 +47,10 @@ public class RSocketServiceMethodTests {
@BeforeEach
public void setUp() throws Exception {
public void setUp() {
this.rsocket = new TestRSocket();
RSocketRequester requester = RSocketRequester.wrap(this.rsocket, TEXT_PLAIN, TEXT_PLAIN, RSocketStrategies.create());
this.proxyFactory = new RSocketServiceProxyFactory(requester);
this.proxyFactory.afterPropertiesSet();
this.proxyFactory = RSocketServiceProxyFactory.builder(requester).build();
}