From bd87ba33d0946e3d6c9a3b6a5f5cdf112305cee9 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 16 Sep 2020 00:15:19 -0700 Subject: [PATCH] Use ephemeral ports for RSocket tests Closes gh-23325 --- .../boot/rsocket/netty/NettyRSocketServerFactoryTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java index 2958e76cc5..269c443c00 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java @@ -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 accept(ConnectionSetupPayload setupPayload, RSocket rSocket) { return Mono.just(new AbstractRSocket() { + @Override public Mono requestResponse(Payload payload) { return Mono.just(DefaultPayload.create(payload)); } + }); }