@@ -50,7 +50,7 @@ public void prepareForTests() {
5050 if (!preparedForTests .get ()) {
5151 Integer mappedPort = aemPort ();
5252
53- startAem (mappedPort );
53+ startAem (mappedPort , targetType );
5454 // deploySampleFiles(mappedPort);
5555
5656 preparedForTests .set (true );
@@ -59,11 +59,15 @@ public void prepareForTests() {
5959 }
6060
6161 // Make sure AEM is up before running the tests.
62- private static void startAem (Integer mappedPort ) {
63- System .out .println (String .format ("Checking if AEM is available on port %d." , mappedPort ));
62+ private static void startAem (Integer mappedPort , AemTargetType targetType ) {
63+ String targetMachine = switch (targetType ) {
64+ case LOCAL , TESTCONTAINERS -> "localhost" ;
65+ case REMOTE_WINDOWS , REMOTE_LINUX -> TestUtils .TEST_MACHINE_NAME ;
66+ };
67+ System .out .println (String .format ("Checking if AEM is available on port %d of %s." , mappedPort , targetMachine ));
6468 HttpClient client = HttpClient .newHttpClient ();
6569 HttpRequest request = HttpRequest .newBuilder ()
66- .uri (URI .create (String .format ("http://localhost :%d/" , mappedPort )))
70+ .uri (URI .create (String .format ("http://%s :%d/" , targetMachine , mappedPort )))
6771 .header ("Authorization" , encodeBasic (TestUtils .TEST_USER , TestUtils .TEST_USER_PASSWORD ))
6872 .GET ()
6973 .build ();
0 commit comments