diff --git a/pom.xml b/pom.xml index a552bf6..0907410 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.boomerang lib-eventing - 0.2.3 + 0.2.4 Boomerang Lib Eventing https://github.com/boomerang-io/lib.eventing @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-core - 2.16.0 + 2.17.1 org.jacoco @@ -35,19 +35,19 @@ org.junit.jupiter junit-jupiter-engine - 5.8.1 + 5.8.2 test berlin.yuna nats-server - 2.2.25 + 2.6.16 test org.awaitility awaitility - 4.1.0 + 4.1.1 test diff --git a/src/main/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiver.java b/src/main/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiver.java index be616de..efd76ac 100644 --- a/src/main/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiver.java +++ b/src/main/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiver.java @@ -135,7 +135,7 @@ public void unsubscribe() { } // Unset the subscription - subHandlerRef = null; + subHandlerRef = new WeakReference<>(null); jetstreamSubscription = null; subscriptionActive.set(false); } diff --git a/src/test/java/io/boomerang/eventing/nats/ConnectionPrimerTest.java b/src/test/java/io/boomerang/eventing/nats/ConnectionPrimerTest.java index 2bcdf1d..c9e7bfa 100644 --- a/src/test/java/io/boomerang/eventing/nats/ConnectionPrimerTest.java +++ b/src/test/java/io/boomerang/eventing/nats/ConnectionPrimerTest.java @@ -42,8 +42,7 @@ public class ConnectionPrimerTest { @BeforeEach void setupNatsServer() { // @formatter:off - natsServer = new Nats() - .port(SERVER_PORT) + natsServer = new Nats(SERVER_PORT) .config(NatsConfig.JETSTREAM, "true") .config(NatsConfig.STORE_DIR, jetstreamStoreDir); // @formatter:on @@ -62,7 +61,7 @@ void cleanUpServer() { } @Test - public void testConnectToServer() throws IOException { + public void testConnectToServer() throws Exception { natsServer.start(); final ConnectionPrimer connectionPrimer = new ConnectionPrimer(serverUrl); @@ -76,7 +75,7 @@ public void testConnectToServer() throws IOException { } @Test - public void testConnectBeforeServerStarted() throws IOException, InterruptedException { + public void testConnectBeforeServerStarted() throws Exception { final ConnectionPrimer connectionPrimer = new ConnectionPrimer( new Options.Builder().server(serverUrl).reconnectWait(Duration.ofMillis(500))); @@ -107,7 +106,7 @@ public void testNeverConnected() throws InterruptedException { } @Test - public void testListenerUpdates() throws IOException, InterruptedException { + public void testListenerUpdates() throws Exception { final AtomicBoolean serverIsOnline = new AtomicBoolean(false); final AtomicInteger fails = new AtomicInteger(); diff --git a/src/test/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiverTest.java b/src/test/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiverTest.java index 5dc8f79..b9fb984 100644 --- a/src/test/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiverTest.java +++ b/src/test/java/io/boomerang/eventing/nats/jetstream/PubSubTransceiverTest.java @@ -45,8 +45,7 @@ public class PubSubTransceiverTest { @BeforeEach void setupNatsServer() { // @formatter:off - natsServer = new Nats() - .port(SERVER_PORT) + natsServer = new Nats(SERVER_PORT) .config(NatsConfig.JETSTREAM, "true") .config(NatsConfig.STORE_DIR, jetstreamStoreDir); // @formatter:on @@ -65,7 +64,7 @@ void cleanUpServer() { } @Test - void testPubSubPushConsumer() throws IOException, InterruptedException { + void testPubSubPushConsumer() throws Exception { List testSubjects = List.of("test1", "test2", "test3", "test4", "test4"); String testMessage = "Test message!"; @@ -103,7 +102,7 @@ public void newMessageReceived(PubSubTunnel tunnel, String subject, String messa } @Test - void testPubSubPullConsumer() throws IOException, InterruptedException { + void testPubSubPullConsumer() throws Exception { List testSubjects = List.of("test1", "test2", "test3", "test4", "test4"); String testMessage = "Test message!"; diff --git a/src/test/java/io/boomerang/eventing/nats/jetstream/PubTransmitterTest.java b/src/test/java/io/boomerang/eventing/nats/jetstream/PubTransmitterTest.java index d9b83ad..49753da 100644 --- a/src/test/java/io/boomerang/eventing/nats/jetstream/PubTransmitterTest.java +++ b/src/test/java/io/boomerang/eventing/nats/jetstream/PubTransmitterTest.java @@ -42,8 +42,7 @@ public class PubTransmitterTest { @BeforeEach void setupNatsServer() { // @formatter:off - natsServer = new Nats() - .port(SERVER_PORT) + natsServer = new Nats(SERVER_PORT) .config(NatsConfig.JETSTREAM, "true") .config(NatsConfig.STORE_DIR, jetstreamStoreDir); // @formatter:on @@ -62,7 +61,7 @@ void cleanUpServer() { } @Test - void testSubjectMatch() throws IOException { + void testSubjectMatch() throws Exception { natsServer.start(); final ConnectionPrimer connectionPrimer = new ConnectionPrimer(serverUrl); @@ -79,7 +78,7 @@ void testSubjectMatch() throws IOException { } @Test - void testCreateStream() throws IOException { + void testCreateStream() throws Exception { natsServer.start(); final ConnectionPrimer connectionPrimer = new ConnectionPrimer(serverUrl); @@ -103,7 +102,7 @@ void testCreateStream() throws IOException { } @Test - void testServerConnection() throws IOException, InterruptedException { + void testServerConnection() throws Exception { final ConnectionPrimer connectionPrimer = new ConnectionPrimer( new Options.Builder().server(serverUrl).reconnectWait(Duration.ofMillis(500)));