Skip to content

Commit

Permalink
Create new ActorSystem for cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
ningyougang committed Aug 22, 2022
1 parent 5cbe252 commit ab20c81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/src/test/scala/system/basic/HttpProxy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/
package system.basic
import akka.actor.ActorSystem

import java.net.ServerSocket
import akka.http.scaladsl.{ConnectionContext, Http}
import akka.http.scaladsl.model.{HttpRequest, HttpResponse, Uri}
Expand Down Expand Up @@ -43,6 +45,7 @@ trait HttpProxy extends WskActorSystem with ScalaFutures {
implicit val testConfig: PatienceConfig = PatienceConfig(1.minute)

def withProxy(check: (WskProps, ListBuffer[(HttpRequest, HttpResponse)]) => Unit)(implicit wp: WskProps): Unit = {
implicit val actorSystem = ActorSystem("test-openwhisk-cli")
val uri = getTargetUri(wp)
val requests = new ListBuffer[(HttpRequest, HttpResponse)]
val port = freePort()
Expand Down Expand Up @@ -77,7 +80,7 @@ trait HttpProxy extends WskActorSystem with ScalaFutures {
}
}

private def makeHttpFlow(uri: Uri) = {
private def makeHttpFlow(uri: Uri)(implicit actorSystem: ActorSystem) = {
if (uri.scheme == "https") {
//Use ssl config which does not validate anything
Http(actorSystem).outgoingConnectionHttps(
Expand Down

0 comments on commit ab20c81

Please sign in to comment.