@@ -39,16 +39,15 @@ public class EdgeServiceIntegrationTests {
39
39
@ ClassRule
40
40
public static DockerComposeRule docker = DockerComposeRule .builder ().pullOnStartup (true )
41
41
.file ("src/test/resources/docker-compose.yml" )
42
- .waitingForService ("userservice" , HealthChecks .toHaveAllPortsOpen ())
42
+ .waitingForService ("discoveryservice" , HealthChecks .toHaveAllPortsOpen ())
43
+ .waitingForService ("mysqlserver" , HealthChecks .toHaveAllPortsOpen ())
43
44
.waitingForService ("mongo" , HealthChecks .toHaveAllPortsOpen ())
44
45
.waitingForService ("rabbitmq" , HealthChecks .toHaveAllPortsOpen ())
46
+ .waitingForService ("userservice" , HealthChecks .toHaveAllPortsOpen ())
45
47
.waitingForService ("tripmanagementcmd" , HealthChecks .toHaveAllPortsOpen ())
46
48
.waitingForService ("tripmanagementquery" , HealthChecks .toHaveAllPortsOpen ())
47
49
.waitingForService ("gmapsadapter" , HealthChecks .toHaveAllPortsOpen ())
48
50
.waitingForService ("calculationservice" , HealthChecks .toHaveAllPortsOpen ())
49
- .waitingForService ("discoveryservice" , HealthChecks .toHaveAllPortsOpen ())
50
- .waitingForService ("discoveryservice" , HealthChecks .toRespondOverHttp (8761 ,
51
- (port ) -> port .inFormat ("http://localhost:8761" )))
52
51
.build ();
53
52
54
53
//Get IP addresses and ports to run tests on
@@ -59,18 +58,30 @@ public static void initialize() {
59
58
.port (8080 );
60
59
tripCommandURL = String .format ("http://%s:%s" , tripManagementCommand .getIp (),
61
60
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
+ }
62
65
LOG .info ("Trip Command url found: " + tripCommandURL );
63
66
64
67
DockerPort tripManagementQuery = docker .containers ().container ("tripmanagementquery" )
65
68
.port (8080 );
66
69
tripQueryURL = String .format ("http://%s:%s" , tripManagementQuery .getIp (),
67
70
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
+ }
68
75
LOG .info ("Trip Query url found: " + tripQueryURL );
69
76
70
77
DockerPort gmapsAdapter = docker .containers ().container ("gmapsadapter" )
71
78
.port (8080 );
72
79
gmapsAdapterURL = String .format ("http://%s:%s" , gmapsAdapter .getIp (),
73
80
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
+ }
74
85
LOG .info ("Gmaps Adapter url found: " + gmapsAdapterURL );
75
86
76
87
DockerPort calculationService = docker .containers ().container ("calculationservice" )
0 commit comments