Skip to content

Commit

Permalink
Merge pull request nats-io#436 from nats-io/verified-update-stream-be…
Browse files Browse the repository at this point in the history
…ta-2

Verified update stream beta 2
  • Loading branch information
ColinSullivan1 authored Mar 22, 2021
2 parents f190371 + 3c34947 commit 56428bd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import aQute.bnd.gradle.Bundle
def versionMajor = 2
def versionMinor = 9
def versionPatch = 0
def versionRevision = "-beta-1" // Empty string when not using, otherwise include the dot, i.e. '.RC1' or '.Beta1' or '.123'
def versionRevision = "-beta-2" // Empty string when not using, otherwise include the dot, i.e. '.RC1' or '.Beta1' or '.123'
def jarVersion = "" + versionMajor + "." + versionMinor + "." + versionPatch + versionRevision
def secureEnv = System.getenv("TRAVIS_SECURE_ENV_VARS") != null ? System.getenv("TRAVIS_SECURE_ENV_VARS") : "false"
def branch = System.getenv("TRAVIS_BRANCH") != null ? System.getenv("TRAVIS_BRANCH") : ""
Expand Down
27 changes: 22 additions & 5 deletions src/test/java/io/nats/client/impl/JetStreamManagementTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,46 @@ public void addStream() throws Exception {
public void updateStream() throws Exception {
runInJsServer(nc -> {
JetStreamManagement jsm = nc.jetStreamManagement();
addTestStream(jsm);
StreamInfo si = addTestStream(jsm);
StreamConfiguration sc = si.getConfiguration();
assertNotNull(sc);
assertEquals(STREAM, sc.getName());
assertNotNull(sc.getSubjects());
assertEquals(2, sc.getSubjects().size());
assertEquals(subject(0), sc.getSubjects().get(0));
assertEquals(subject(1), sc.getSubjects().get(1));
assertEquals(-1, sc.getMaxBytes());
assertEquals(-1, sc.getMaxMsgSize());
assertEquals(Duration.ZERO, sc.getMaxAge());
assertEquals(StorageType.Memory, sc.getStorageType());
assertEquals(DiscardPolicy.Old, sc.getDiscardPolicy());
assertEquals(1, sc.getReplicas());
assertFalse(sc.getNoAck());
assertEquals(Duration.ofMinutes(2), sc.getDuplicateWindow());
assertNull(sc.getTemplateOwner());

StreamConfiguration sc = StreamConfiguration.builder()
sc = StreamConfiguration.builder()
.name(STREAM)
.storageType(StorageType.Memory)
.subjects(subject(0), subject(1))
.subjects(subject(0), subject(1), subject(2))
.maxBytes(43)
.maxMsgSize(44)
.maxAge(Duration.ofDays(100))
.discardPolicy(DiscardPolicy.New)
.noAck(true)
.duplicateWindow(Duration.ofMinutes(3))
.build();
StreamInfo si = jsm.updateStream(sc);
si = jsm.updateStream(sc);
assertNotNull(si);

sc = si.getConfiguration();
assertNotNull(sc);
assertEquals(STREAM, sc.getName());
assertNotNull(sc.getSubjects());
assertEquals(2, sc.getSubjects().size());
assertEquals(3, sc.getSubjects().size());
assertEquals(subject(0), sc.getSubjects().get(0));
assertEquals(subject(1), sc.getSubjects().get(1));
assertEquals(subject(2), sc.getSubjects().get(2));
assertEquals(43, sc.getMaxBytes());
assertEquals(44, sc.getMaxMsgSize());
assertEquals(Duration.ofDays(100), sc.getMaxAge());
Expand Down

0 comments on commit 56428bd

Please sign in to comment.