2424/**
2525 * Integration tests that connect to an already-running GOSS server process.
2626 *
27- * Unlike {@link GossEndToEndTest} which embeds its own ActiveMQ broker,
28- * these tests hit a real GOSS server externally — the same way Python/STOMP
29- * clients (and the companion test_stomp_token_auth.py) connect.
27+ * Unlike {@link GossEndToEndTest} which embeds its own ActiveMQ broker, these
28+ * tests hit a real GOSS server externally — the same way Python/STOMP clients
29+ * (and the companion test_stomp_token_auth.py) connect.
3030 *
3131 * This validates the full stack: ActiveMQ transport, Shiro authentication,
3232 * message routing, and pub/sub — from a GossClient over OpenWire.
3333 *
34- * Configuration (system properties or environment variables):
35- * goss.openwire.uri / GOSS_OPENWIRE_URI (default: tcp://localhost:61617)
36- * goss.stomp.uri / GOSS_STOMP_URI (default: stomp://localhost:61618)
37- * goss.username / GOSS_USERNAME (default: system)
38- * goss.password / GOSS_PASSWORD (default: manager)
34+ * Configuration (system properties or environment variables): goss.openwire.uri
35+ * / GOSS_OPENWIRE_URI (default: tcp://localhost:61617) goss.stomp.uri /
36+ * GOSS_STOMP_URI (default: stomp://localhost:61618) goss.username /
37+ * GOSS_USERNAME (default: system) goss.password / GOSS_PASSWORD (default:
38+ * manager)
3939 *
40- * Run:
41- * ./gradlew :pnnl.goss.core.itests:testExternal
40+ * Run: ./gradlew :pnnl.goss.core.itests:testExternal
4241 */
4342@ TestInstance (Lifecycle .PER_CLASS )
4443@ TestMethodOrder (MethodOrderer .MethodName .class )
@@ -51,21 +50,25 @@ public class GossExternalServerTest {
5150 private String username ;
5251 private String password ;
5352
54- /** Read config from system properties, falling back to env vars, then defaults. */
53+ /**
54+ * Read config from system properties, falling back to env vars, then defaults.
55+ */
5556 private static String config (String sysProp , String envVar , String defaultVal ) {
5657 String val = System .getProperty (sysProp );
57- if (val != null && !val .isEmpty ()) return val ;
58+ if (val != null && !val .isEmpty ())
59+ return val ;
5860 val = System .getenv (envVar );
59- if (val != null && !val .isEmpty ()) return val ;
61+ if (val != null && !val .isEmpty ())
62+ return val ;
6063 return defaultVal ;
6164 }
6265
6366 @ BeforeAll
6467 public void setUp () {
6568 openwireUri = config ("goss.openwire.uri" , "GOSS_OPENWIRE_URI" , "tcp://localhost:61617" );
66- stompUri = config ("goss.stomp.uri" , "GOSS_STOMP_URI" , "stomp://localhost:61618" );
67- username = config ("goss.username" , "GOSS_USERNAME" , "system" );
68- password = config ("goss.password" , "GOSS_PASSWORD" , "manager" );
69+ stompUri = config ("goss.stomp.uri" , "GOSS_STOMP_URI" , "stomp://localhost:61618" );
70+ username = config ("goss.username" , "GOSS_USERNAME" , "system" );
71+ password = config ("goss.password" , "GOSS_PASSWORD" , "manager" );
6972
7073 System .out .println ("GossExternalServerTest targeting:" );
7174 System .out .println (" OpenWire: " + openwireUri );
@@ -158,8 +161,14 @@ public void test03_multipleSubscribers() throws Exception {
158161 AtomicReference <String > msg1 = new AtomicReference <>();
159162 AtomicReference <String > msg2 = new AtomicReference <>();
160163
161- sub1 .subscribe (topic , response -> { msg1 .set (response .toString ()); latch .countDown (); });
162- sub2 .subscribe (topic , response -> { msg2 .set (response .toString ()); latch .countDown (); });
164+ sub1 .subscribe (topic , response -> {
165+ msg1 .set (response .toString ());
166+ latch .countDown ();
167+ });
168+ sub2 .subscribe (topic , response -> {
169+ msg2 .set (response .toString ());
170+ latch .countDown ();
171+ });
163172
164173 Thread .sleep (200 );
165174 publisher .publish (topic , message );
@@ -241,8 +250,14 @@ public void test06_multipleTopics() throws Exception {
241250 AtomicReference <String > msgA = new AtomicReference <>();
242251 AtomicReference <String > msgB = new AtomicReference <>();
243252
244- client .subscribe (topicA , response -> { msgA .set (response .toString ()); latch .countDown (); });
245- client .subscribe (topicB , response -> { msgB .set (response .toString ()); latch .countDown (); });
253+ client .subscribe (topicA , response -> {
254+ msgA .set (response .toString ());
255+ latch .countDown ();
256+ });
257+ client .subscribe (topicB , response -> {
258+ msgB .set (response .toString ());
259+ latch .countDown ();
260+ });
246261
247262 Thread .sleep (200 );
248263 client .publish (topicA , "Message for A" );
0 commit comments