@@ -131,16 +131,18 @@ func (c *testComamnd) Execute() {
131131 os .Exit (1 )
132132 }
133133
134- // Second - retrieve an OAuth token using Keycloak Client.
135- kc := connectors .NewKeycloakClient (keycloakURL , keycloakClientID , keycloakClientSecret )
134+ var oauthToken string = "unauthentifed-token"
135+ if keycloakURL != "null" {
136+ // If Keycloak is enabled, retrieve an OAuth token using Keycloak Client.
137+ kc := connectors .NewKeycloakClient (keycloakURL , keycloakClientID , keycloakClientSecret )
136138
137- var oauthToken string
138- oauthToken , err = kc .ConnectAndGetToken ()
139- if err != nil {
140- fmt .Printf ("Got error when invoking Keycloack client: %s" , err )
141- os .Exit (1 )
139+ oauthToken , err = kc .ConnectAndGetToken ()
140+ if err != nil {
141+ fmt .Printf ("Got error when invoking Keycloack client: %s" , err )
142+ os .Exit (1 )
143+ }
144+ //fmt.Printf("Retrieve OAuthToken: %s", oauthToken)
142145 }
143- //fmt.Printf("Retrieve OAuthToken: %s", oauthToken)
144146
145147 // Then - launch the test on Microcks Server.
146148 mc .SetOAuthToken (oauthToken )
@@ -153,10 +155,12 @@ func (c *testComamnd) Execute() {
153155 }
154156 //fmt.Printf("Retrieve TestResult ID: %s", testResultID)
155157
156- // Finally - wait for some time
157- // Add 5000ms to wait time as it's now representing the server timeout.
158+ // Finally - wait before checking and loop for some time
159+ time .Sleep (1 * time .Second )
160+
161+ // Add 10.000ms to wait time as it's now representing the server timeout.
158162 now := nowInMilliseconds ()
159- future := now + waitForMilliseconds + 5000
163+ future := now + waitForMilliseconds + 10000
160164
161165 var success = false
162166 for nowInMilliseconds () < future {
0 commit comments