Use ephemeral ports for RSocket tests

Closes gh-23325
This commit is contained in:
Phillip Webb 2020-09-16 00:15:19 -07:00
parent 195def0ec3
commit bd87ba33d0
1 changed files with 5 additions and 1 deletions

View File

@ -83,7 +83,9 @@ class NettyRSocketServerFactoryTests {
}
private NettyRSocketServerFactory getFactory() {
return new NettyRSocketServerFactory();
NettyRSocketServerFactory factory = new NettyRSocketServerFactory();
factory.setPort(0);
return factory;
}
@Test
@ -189,10 +191,12 @@ class NettyRSocketServerFactoryTests {
@Override
public Mono<RSocket> accept(ConnectionSetupPayload setupPayload, RSocket rSocket) {
return Mono.just(new AbstractRSocket() {
@Override
public Mono<Payload> requestResponse(Payload payload) {
return Mono.just(DefaultPayload.create(payload));
}
});
}