@@ -39,16 +39,15 @@ public class EdgeServiceIntegrationTests {
3939 @ ClassRule
4040 public static DockerComposeRule docker = DockerComposeRule .builder ().pullOnStartup (true )
4141 .file ("src/test/resources/docker-compose.yml" )
42- .waitingForService ("userservice" , HealthChecks .toHaveAllPortsOpen ())
42+ .waitingForService ("discoveryservice" , HealthChecks .toHaveAllPortsOpen ())
43+ .waitingForService ("mysqlserver" , HealthChecks .toHaveAllPortsOpen ())
4344 .waitingForService ("mongo" , HealthChecks .toHaveAllPortsOpen ())
4445 .waitingForService ("rabbitmq" , HealthChecks .toHaveAllPortsOpen ())
46+ .waitingForService ("userservice" , HealthChecks .toHaveAllPortsOpen ())
4547 .waitingForService ("tripmanagementcmd" , HealthChecks .toHaveAllPortsOpen ())
4648 .waitingForService ("tripmanagementquery" , HealthChecks .toHaveAllPortsOpen ())
4749 .waitingForService ("gmapsadapter" , HealthChecks .toHaveAllPortsOpen ())
4850 .waitingForService ("calculationservice" , HealthChecks .toHaveAllPortsOpen ())
49- .waitingForService ("discoveryservice" , HealthChecks .toHaveAllPortsOpen ())
50- .waitingForService ("discoveryservice" , HealthChecks .toRespondOverHttp (8761 ,
51- (port ) -> port .inFormat ("http://localhost:8761" )))
5251 .build ();
5352
5453 //Get IP addresses and ports to run tests on
@@ -59,18 +58,30 @@ public static void initialize() {
5958 .port (8080 );
6059 tripCommandURL = String .format ("http://%s:%s" , tripManagementCommand .getIp (),
6160 tripManagementCommand .getExternalPort ());
61+ while (!docker .containers ().container ("tripmanagementcmd" ).portIsListeningOnHttp (8080 ,
62+ (port ) -> port .inFormat (tripCommandURL )).succeeded ()) {
63+ LOG .info ("Waiting for Trip Command to respond over HTTP" );
64+ }
6265 LOG .info ("Trip Command url found: " + tripCommandURL );
6366
6467 DockerPort tripManagementQuery = docker .containers ().container ("tripmanagementquery" )
6568 .port (8080 );
6669 tripQueryURL = String .format ("http://%s:%s" , tripManagementQuery .getIp (),
6770 tripManagementQuery .getExternalPort ());
71+ while (!docker .containers ().container ("tripmanagementquery" ).portIsListeningOnHttp (8080 ,
72+ (port ) -> port .inFormat (tripQueryURL )).succeeded ()) {
73+ LOG .info ("Waiting for Trip Query to respond over HTTP" );
74+ }
6875 LOG .info ("Trip Query url found: " + tripQueryURL );
6976
7077 DockerPort gmapsAdapter = docker .containers ().container ("gmapsadapter" )
7178 .port (8080 );
7279 gmapsAdapterURL = String .format ("http://%s:%s" , gmapsAdapter .getIp (),
7380 gmapsAdapter .getExternalPort ());
81+ while (!docker .containers ().container ("gmapsadapter" ).portIsListeningOnHttp (8080 ,
82+ (port ) -> port .inFormat (gmapsAdapterURL )).succeeded ()) {
83+ LOG .info ("Waiting for user service to respond over HTTP" );
84+ }
7485 LOG .info ("Gmaps Adapter url found: " + gmapsAdapterURL );
7586
7687 DockerPort calculationService = docker .containers ().container ("calculationservice" )
0 commit comments