From 00eb4e24c776869f7113e0e43f8359f88657ae07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 9 Apr 2024 11:41:22 +0200 Subject: [PATCH] fix --- .../pulsar/jms/VirtualDestinationsConsumerTest.java | 4 ++-- .../pulsar/jms/utils/PulsarContainerExtension.java | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/VirtualDestinationsConsumerTest.java b/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/VirtualDestinationsConsumerTest.java index a84d2da0..99f6fdf8 100644 --- a/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/VirtualDestinationsConsumerTest.java +++ b/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/VirtualDestinationsConsumerTest.java @@ -465,8 +465,8 @@ public void testPatternConsumerAddingTopicWithServerSideFilters() throws Excepti pulsarContainer .getAdmin() .topics() - .createSubscription( - topicName, "jms-queue", MessageId.earliest, false, subscriptionProperties); + .updateSubscriptionProperties( + topicName, "jms-queue", subscriptionProperties); Queue newDestination = session.createQueue(topicName); TextMessage nextMessage = session.createTextMessage("new"); diff --git a/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/utils/PulsarContainerExtension.java b/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/utils/PulsarContainerExtension.java index 66c001fb..f9124b92 100644 --- a/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/utils/PulsarContainerExtension.java +++ b/pulsar-jms/src/test/java/com/datastax/oss/pulsar/jms/utils/PulsarContainerExtension.java @@ -31,6 +31,7 @@ @Slf4j public class PulsarContainerExtension implements BeforeAllCallback, AfterAllCallback { + public static final String PULSAR_IMAGE = "apachepulsar/pulsar:3.0.0"; private PulsarContainer pulsarContainer; private Consumer onContainerReady; private Map env = new HashMap<>(); @@ -67,7 +68,7 @@ public void afterAll(ExtensionContext extensionContext) { public void beforeAll(ExtensionContext extensionContext) { network = Network.newNetwork(); pulsarContainer = - new PulsarContainer(DockerImageName.parse("apachepulsar/pulsar:3.0.0")) + new PulsarContainer(DockerImageName.parse(PULSAR_IMAGE)) .withNetwork(network) .withEnv(env) .withLogConsumer( @@ -76,13 +77,13 @@ public void beforeAll(ExtensionContext extensionContext) { MountableFile.forHostPath("target/classes/filters"), "/pulsar/filters"); // start Pulsar and wait for it to be ready to accept requests pulsarContainer.start(); + admin = + PulsarAdmin.builder() + .serviceHttpUrl("http://localhost:" + pulsarContainer.getMappedPort(8080)) + .build(); if (onContainerReady != null) { onContainerReady.accept(this); } - admin = - PulsarAdmin.builder() - .serviceHttpUrl("http://localhost:" + pulsarContainer.getMappedPort(8080)) - .build(); } public PulsarContainerExtension withOnContainerReady(