@@ -30,6 +30,7 @@ import org.junit.runner.RunWith
30
30
import org .scalatest .Matchers
31
31
import org .scalatest .concurrent .ScalaFutures
32
32
import org .scalatest .junit .JUnitRunner
33
+ import pureconfig .loadConfigOrThrow
33
34
import spray .json ._
34
35
import system .rest .RestUtil
35
36
@@ -76,16 +77,16 @@ class RuntimeConfigurationTests
76
77
} """
77
78
}
78
79
79
- val invokerProtocol = WhiskProperties .getInvokerProtocol
80
+ val invokerProtocol = loadConfigOrThrow[ String ]( " whisk.invoker.protocol " )
80
81
val invokerAddress = WhiskProperties .getBaseInvokerAddress
81
- val invokerUsername = WhiskProperties .getInvokerUsername
82
- val invokerPassword = WhiskProperties .getInvokerPassword
82
+ val invokerUsername = loadConfigOrThrow[ String ]( " whisk.credentials.invoker.username " )
83
+ val invokerPassword = loadConfigOrThrow[ String ]( " whisk.credentials.invoker.password " )
83
84
val invokerAuthHeader = Authorization (BasicHttpCredentials (invokerUsername, invokerPassword))
84
85
85
- val controllerProtocol = WhiskProperties .getControllerProtocol
86
+ val controllerProtocol = loadConfigOrThrow[ String ]( " whisk.controller.protocol " )
86
87
val controllerAddress = WhiskProperties .getBaseControllerAddress
87
- val controllerUsername = WhiskProperties .getControllerUsername
88
- val controllerPassword = WhiskProperties .getControllerPassword
88
+ val controllerUsername = loadConfigOrThrow[ String ]( " whisk.credentials.controller.username " )
89
+ val controllerPassword = loadConfigOrThrow[ String ]( " whisk.credentials.controller.password " )
89
90
val controllerAuthHeader = Authorization (BasicHttpCredentials (controllerUsername, controllerPassword))
90
91
91
92
val getRuntimeUrl = s " ${invokerProtocol}:// ${invokerAddress}/getRuntime "
@@ -104,9 +105,10 @@ class RuntimeConfigurationTests
104
105
entity = HttpEntity (ContentTypes .`text/plain(UTF-8)`, getRuntimes)),
105
106
connectionContext = HttpConnection .getContext(invokerProtocol))
106
107
.map { response =>
107
- response.status shouldBe StatusCodes .OK
108
+ response.status shouldBe StatusCodes .Accepted
108
109
}
109
110
111
+ // Make sure previous http post call successfully
110
112
Thread .sleep(5 .seconds.toMillis)
111
113
112
114
// Cal the prewarm container number whether right
@@ -136,9 +138,10 @@ class RuntimeConfigurationTests
136
138
entity = HttpEntity (ContentTypes .`text/plain(UTF-8)`, getRuntimes)),
137
139
connectionContext = HttpConnection .getContext(controllerProtocol))
138
140
.map { response =>
139
- response.status shouldBe StatusCodes .OK
141
+ response.status shouldBe StatusCodes .Accepted
140
142
}
141
143
144
+ // Make sure previous http post call successfully
142
145
Thread .sleep(5 .seconds.toMillis)
143
146
144
147
// Cal the prewarm container number whether right
0 commit comments