Skip to content

Commit

Permalink
Fixed tests for 2.8.4 regression stream and consumer metadata (#1225)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf authored Sep 13, 2024
1 parent 4d51fa1 commit 45b2c66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testStreamCreate() throws Exception {

@Test
public void testStreamMetadata() throws Exception {
jsServer.run(nc -> {
jsServer.run(TestBase::atLeast2_9_0, nc -> {
Map<String, String> metaData = new HashMap<>(); metaData.put(META_KEY, META_VALUE);
JetStreamManagement jsm = nc.jetStreamManagement();

Expand Down
6 changes: 5 additions & 1 deletion src/test/java/io/nats/client/utils/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ public interface VersionCheck {
boolean runTest(ServerInfo si);
}

public static boolean atLeast2_9_0() {
return atLeast2_9_0(RUN_SERVER_INFO);
}

public static boolean atLeast2_9_0(Connection nc) {
return atLeast2_9_0(nc.getServerInfo());
}
Expand Down Expand Up @@ -842,7 +846,7 @@ public static void assertMetaData(Map<String, String> metadata) {
}
assertEquals(META_VALUE, metadata.get(META_KEY));
}
else {
else if (atLeast2_9_0() ){
assertNotNull(metadata);
assertEquals(0, metadata.size());
}
Expand Down

0 comments on commit 45b2c66

Please sign in to comment.