Skip to content

Commit bd87ba3

Browse files
committed
Use ephemeral ports for RSocket tests
Closes gh-23325
1 parent 195def0 commit bd87ba3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ void tearDown() {
8383
}
8484

8585
private NettyRSocketServerFactory getFactory() {
86-
return new NettyRSocketServerFactory();
86+
NettyRSocketServerFactory factory = new NettyRSocketServerFactory();
87+
factory.setPort(0);
88+
return factory;
8789
}
8890

8991
@Test
@@ -189,10 +191,12 @@ static class EchoRequestResponseAcceptor implements SocketAcceptor {
189191
@Override
190192
public Mono<RSocket> accept(ConnectionSetupPayload setupPayload, RSocket rSocket) {
191193
return Mono.just(new AbstractRSocket() {
194+
192195
@Override
193196
public Mono<Payload> requestResponse(Payload payload) {
194197
return Mono.just(DefaultPayload.create(payload));
195198
}
199+
196200
});
197201
}
198202

0 commit comments

Comments
 (0)