@@ -373,7 +373,7 @@ void authenticationHeaderIsSentOnlyOverVerifiedTls(@TempDir Path temporary) thro
373373 AtomicReference <String > receivedUri = new AtomicReference <>();
374374 OpenCliTlsFixture tls = OpenCliTlsFixture .create (temporary );
375375 SSLContext previous = SSLContext .getDefault ();
376- try (JsonCollectStub stub = JsonCollectStub .start (tls .getServer (), exchange -> {
376+ try (JsonCollectStub stub = JsonCollectStub .start (tls .getServer (), "/agent/collect" , exchange -> {
377377 receivedCredential .set (exchange .getRequestHeaders ().getFirst (header ));
378378 receivedUri .set (exchange .getRequestURI ().toASCIIString ());
379379 // The synthetic fixture supports only this explicit header.
@@ -389,7 +389,7 @@ void authenticationHeaderIsSentOnlyOverVerifiedTls(@TempDir Path temporary) thro
389389 }
390390 })) {
391391 OpenCliProperties props = baseProps (stub .port ());
392- props .setRemoteAgentBaseUrl ("https://127.0.0.1:" + stub .port ());
392+ props .setRemoteAgentBaseUrl ("https://127.0.0.1:" + stub .port () + "/agent///" );
393393 props .setRemoteAuthentication (new OpenCliRemoteAuthentication (header , credential ));
394394 Assertions .assertFalse (props .toString ().contains (credential ));
395395 Assertions .assertNull (props .copyForLocalCliExecution ().getRemoteAuthentication ());
@@ -405,7 +405,7 @@ void authenticationHeaderIsSentOnlyOverVerifiedTls(@TempDir Path temporary) thro
405405 try (OpenCliRemoteAgentHttpClient client = new OpenCliRemoteAgentHttpClient (props )) {
406406 Assertions .assertTrue (client .collect (request ).isSuccess ());
407407 Assertions .assertEquals (credential , receivedCredential .get ());
408- Assertions .assertEquals ("/collect" , receivedUri .get ());
408+ Assertions .assertEquals ("/agent/ collect" , receivedUri .get ());
409409 Assertions .assertFalse (stub .requestBody .contains (credential ));
410410 props .setRemoteAuthentication (new OpenCliRemoteAuthentication (header , "rejected-" + credential ));
411411 ByteArrayOutputStream diagnostics = new ByteArrayOutputStream ();
@@ -719,6 +719,10 @@ static JsonCollectStub start(HttpHandler response) throws IOException {
719719 }
720720
721721 static JsonCollectStub start (SSLContext tls , HttpHandler response ) throws IOException {
722+ return start (tls , "/collect" , response );
723+ }
724+
725+ static JsonCollectStub start (SSLContext tls , String path , HttpHandler response ) throws IOException {
722726 InetSocketAddress address = new InetSocketAddress ("127.0.0.1" , 0 );
723727 HttpServer server ;
724728 if (Objects .isNull (tls )) {
@@ -730,7 +734,7 @@ static JsonCollectStub start(SSLContext tls, HttpHandler response) throws IOExce
730734 }
731735 JsonCollectStub stub = new JsonCollectStub (server , server .getAddress ().getPort ());
732736 server .createContext (
733- "/collect" ,
737+ path ,
734738 new HttpHandler () {
735739 @ Override
736740 public void handle (HttpExchange exchange ) throws IOException {
0 commit comments