Skip to content

Commit

Permalink
Fix usage of NioParams setter in test
Browse files Browse the repository at this point in the history
References #396,#715
  • Loading branch information
acogoluegnes committed Nov 8, 2021
1 parent 830bdc6 commit 7e830e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ public void connectionGetConsumeProtocols() throws Exception {
cf.useSslProtocol(sslContext);
cf.useNio();
AtomicReference<SSLEngine> engine = new AtomicReference<>();
cf.setNioParams(new NioParams()
.setSslEngineConfigurator(sslEngine -> engine.set(sslEngine)));
NioParams nioParams = new NioParams();
nioParams.setSslEngineConfigurator(sslEngine -> engine.set(sslEngine));
cf.setNioParams(nioParams);
try (Connection c = cf.newConnection()) {
CountDownLatch latch = new CountDownLatch(1);
basicGetBasicConsume(c, QUEUE, latch, 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public void connectionGetConsumeProtocols() throws Exception {
AtomicReference<Supplier<String[]>> protocolsSupplier = new AtomicReference<>();
if (TestUtils.USE_NIO) {
cf.useNio();
cf.setNioParams(new NioParams()
.setSslEngineConfigurator(sslEngine -> {
protocolsSupplier.set(() -> sslEngine.getEnabledProtocols());
}));
NioParams nioParams = new NioParams();
nioParams.setSslEngineConfigurator(
sslEngine -> protocolsSupplier.set(() -> sslEngine.getEnabledProtocols())
);
cf.setNioParams(nioParams);
} else {
cf.setSocketConfigurator(socket -> {
SSLSocket s = (SSLSocket) socket;
Expand Down

0 comments on commit 7e830e9

Please sign in to comment.