Skip to content

Commit 7e830e9

Browse files
committed
Fix usage of NioParams setter in test
References #396,#715
1 parent 830bdc6 commit 7e830e9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public void connectionGetConsumeProtocols() throws Exception {
9898
cf.useSslProtocol(sslContext);
9999
cf.useNio();
100100
AtomicReference<SSLEngine> engine = new AtomicReference<>();
101-
cf.setNioParams(new NioParams()
102-
.setSslEngineConfigurator(sslEngine -> engine.set(sslEngine)));
101+
NioParams nioParams = new NioParams();
102+
nioParams.setSslEngineConfigurator(sslEngine -> engine.set(sslEngine));
103+
cf.setNioParams(nioParams);
103104
try (Connection c = cf.newConnection()) {
104105
CountDownLatch latch = new CountDownLatch(1);
105106
basicGetBasicConsume(c, QUEUE, latch, 100);

src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ public void connectionGetConsumeProtocols() throws Exception {
8383
AtomicReference<Supplier<String[]>> protocolsSupplier = new AtomicReference<>();
8484
if (TestUtils.USE_NIO) {
8585
cf.useNio();
86-
cf.setNioParams(new NioParams()
87-
.setSslEngineConfigurator(sslEngine -> {
88-
protocolsSupplier.set(() -> sslEngine.getEnabledProtocols());
89-
}));
86+
NioParams nioParams = new NioParams();
87+
nioParams.setSslEngineConfigurator(
88+
sslEngine -> protocolsSupplier.set(() -> sslEngine.getEnabledProtocols())
89+
);
90+
cf.setNioParams(nioParams);
9091
} else {
9192
cf.setSocketConfigurator(socket -> {
9293
SSLSocket s = (SSLSocket) socket;

0 commit comments

Comments
 (0)