Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Apr 9, 2024
1 parent 00eb4e2 commit 2475802
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tck-client-side-filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
run: mvn -B clean install -DskipTests -Dspotbugs.skip=true

- name: TCK tests - client side filters
run: JAVA_HOME=$JDK8_PATH mvn -B verify -DskipTests -Prun-tck
run: JAVA_HOME=$JDK8_PATH mvn -B verify -DskipTests -Dmaven.main.skip=true -Dmaven.test.skip=true -Prun-tck
2 changes: 1 addition & 1 deletion .github/workflows/tck-server-side-filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
run: mvn -B clean install -DskipTests -Dspotbugs.skip=true

- name: TCK tests - server side filters
run: JAVA_HOME=$JDK8_PATH mvn -B verify -DskipTests -Prun-tck-server-side-filters
run: JAVA_HOME=$JDK8_PATH mvn -B verify -DskipTests -Dmaven.main.skip=true -Dmaven.test.skip=true -Prun-tck-server-side-filters
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
import javax.jms.TextMessage;
import javax.jms.Topic;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.client.admin.PulsarAdminException;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.SubscriptionType;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -459,14 +461,22 @@ public void testPatternConsumerAddingTopicWithServerSideFilters() throws Excepti
// the new topic has server side filters on the jms-queue subscription
String topicName = "test-" + prefix + "-" + nextDestinationId;
factory.getPulsarAdmin().topics().createNonPartitionedTopic(topicName);
// await that the consumer session creates the subscription, then we update it
Awaitility.await()
.untilAsserted(() -> {
List<String> subs = pulsarContainer
.getAdmin()
.topics().getSubscriptions(topicName);
assertEquals(subs.size(), 1);
assertTrue(subs.contains("jms-queue"));
});
Map<String, String> subscriptionProperties = new HashMap<>();
subscriptionProperties.put("jms.selector", "keepme=TRUE");
subscriptionProperties.put("jms.filtering", "true");
pulsarContainer
.getAdmin()
.topics()
.updateSubscriptionProperties(
topicName, "jms-queue", subscriptionProperties);
.getAdmin()
.topics()
.updateSubscriptionProperties(topicName, "jms-queue", subscriptionProperties);

Queue newDestination = session.createQueue(topicName);
TextMessage nextMessage = session.createTextMessage("new");
Expand Down

0 comments on commit 2475802

Please sign in to comment.