From 7ad641d106023c4465c7f7c418b1b0c59c42a60a Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 5 Sep 2019 09:15:55 -0500 Subject: [PATCH] RSocket Tests use Available Port Issue gh-7360 --- .../security/config/annotation/rsocket/JwtITests.java | 2 +- .../rsocket/RSocketMessageHandlerConnectionITests.java | 2 +- .../annotation/rsocket/RSocketMessageHandlerITests.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java index e48f269b16..09f7866728 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java @@ -82,7 +82,7 @@ public class JwtITests { .frameDecoder(PayloadDecoder.ZERO_COPY) .addSocketAcceptorPlugin(this.interceptor) .acceptor(this.handler.responder()) - .transport(TcpServerTransport.create("localhost", 7000)) + .transport(TcpServerTransport.create("localhost", 0)) .start() .block(); } diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java index f6883310fe..a47affc554 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java @@ -75,7 +75,7 @@ public class RSocketMessageHandlerConnectionITests { .frameDecoder(PayloadDecoder.ZERO_COPY) .addSocketAcceptorPlugin(this.interceptor) .acceptor(this.handler.responder()) - .transport(TcpServerTransport.create("localhost", 7000)) + .transport(TcpServerTransport.create("localhost", 0)) .start() .block(); } diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java index 3cbcc2117d..133069ad84 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java @@ -78,14 +78,14 @@ public class RSocketMessageHandlerITests { .frameDecoder(PayloadDecoder.ZERO_COPY) .addSocketAcceptorPlugin(this.interceptor) .acceptor(this.handler.responder()) - .transport(TcpServerTransport.create("localhost", 7000)) + .transport(TcpServerTransport.create("localhost", 0)) .start() .block(); this.requester = RSocketRequester.builder() // .rsocketFactory(factory -> factory.addRequesterPlugin(payloadInterceptor)) .rsocketStrategies(this.handler.getRSocketStrategies()) - .connectTcp("localhost", 7000) + .connectTcp("localhost", this.server.address().getPort()) .block(); }