Minor fix in ping tests, added support for custom info in fake server, created tests for info handling code.
@@ -309,10 +309,14 @@ class NatsConnection implements Connection {
if (this.serverInfoFuture.isDone()) {
this.serverInfo.set(serverInfo);
} else {
- this.serverInfoFuture.complete(serverInfo);
+ this.serverInfoFuture.complete(serverInfo); // Will set in connect thread
}
}
+ NatsServerInfo getInfo() {
+ return this.serverInfo.get();
+ }
+
Options getOptions() {
return this.options;
}
