From aeabc3515eae4da0db523a78acadf984e5a9ba01 Mon Sep 17 00:00:00 2001 From: Chetan Mehrotra Date: Fri, 31 May 2019 12:11:45 +0530 Subject: [PATCH] Update rest-assured to v4.0.0 (#4500) * Update to restassured v4.0 which is compatible with jdk11 * Need to initialize both truststore and keystore for ssl cert to be validated --- tests/build.gradle | 2 +- .../scala/apigw/healthtests/ApiGwEndToEndTests.scala | 2 +- .../openwhisk/core/cli/test/WskWebActionsTests.scala | 4 ++-- .../core/controller/test/ControllerApiTests.scala | 2 +- tests/src/test/scala/system/basic/WskSequenceTests.scala | 2 +- tests/src/test/scala/system/basic/WskUnicodeTests.scala | 2 +- tests/src/test/scala/system/rest/ActionSchemaTests.scala | 2 +- tests/src/test/scala/system/rest/GoCLINginxTests.scala | 2 +- tests/src/test/scala/system/rest/RestUtil.scala | 9 +++++---- tests/src/test/scala/system/rest/SwaggerTests.scala | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/build.gradle b/tests/build.gradle index 9b27ce6a381..c532b79b353 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -185,7 +185,7 @@ dependencies { compile 'org.apache.httpcomponents:httpclient:4.5.2:tests' compile 'org.apache.httpcomponents:httpmime:4.3.6' compile 'junit:junit:4.11' - compile 'com.jayway.restassured:rest-assured:2.6.0' + compile 'io.rest-assured:rest-assured:4.0.0' compile 'org.scalatest:scalatest_2.12:3.0.5' compile "com.typesafe.akka:akka-testkit_2.12:${gradle.akka.version}" compile 'com.google.code.gson:gson:2.3.1' diff --git a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala index a94f96db44d..186e561dbec 100644 --- a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala +++ b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala @@ -29,7 +29,7 @@ import org.scalatest.FlatSpec import org.scalatest.Matchers import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import common.TestHelpers import common.TestUtils diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala index f425d40c083..c2187b7b8ae 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskWebActionsTests.scala @@ -24,8 +24,8 @@ import scala.util.Failure import scala.util.Try import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured -import com.jayway.restassured.response.Header +import io.restassured.RestAssured +import io.restassured.http.Header import common._ import common.rest.WskRestOperations import spray.json._ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala index 3ad4e492d11..4de8bb8d9bf 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ControllerApiTests.scala @@ -21,7 +21,7 @@ import org.junit.runner.RunWith import org.scalatest.FlatSpec import org.scalatest.Matchers import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import common.StreamLogging import spray.json._ import spray.json.DefaultJsonProtocol._ diff --git a/tests/src/test/scala/system/basic/WskSequenceTests.scala b/tests/src/test/scala/system/basic/WskSequenceTests.scala index 99ffd122c1d..06541bdbbd4 100644 --- a/tests/src/test/scala/system/basic/WskSequenceTests.scala +++ b/tests/src/test/scala/system/basic/WskSequenceTests.scala @@ -20,7 +20,7 @@ package system.basic import java.time.Instant import java.util.Date -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import scala.concurrent.duration.DurationInt import scala.language.postfixOps diff --git a/tests/src/test/scala/system/basic/WskUnicodeTests.scala b/tests/src/test/scala/system/basic/WskUnicodeTests.scala index 33680518af2..a2fe0640bb5 100644 --- a/tests/src/test/scala/system/basic/WskUnicodeTests.scala +++ b/tests/src/test/scala/system/basic/WskUnicodeTests.scala @@ -18,7 +18,7 @@ package system.basic import java.io.File -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner diff --git a/tests/src/test/scala/system/rest/ActionSchemaTests.scala b/tests/src/test/scala/system/rest/ActionSchemaTests.scala index a22fccd8486..4868db4cf02 100644 --- a/tests/src/test/scala/system/rest/ActionSchemaTests.scala +++ b/tests/src/test/scala/system/rest/ActionSchemaTests.scala @@ -23,7 +23,7 @@ import org.junit.runner.RunWith import org.scalatest.FlatSpec import org.scalatest.Matchers import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import common._ import common.rest.WskRestOperations import spray.json._ diff --git a/tests/src/test/scala/system/rest/GoCLINginxTests.scala b/tests/src/test/scala/system/rest/GoCLINginxTests.scala index 3621a4d13dd..df72efe7a88 100644 --- a/tests/src/test/scala/system/rest/GoCLINginxTests.scala +++ b/tests/src/test/scala/system/rest/GoCLINginxTests.scala @@ -22,7 +22,7 @@ import org.scalatest.FlatSpec import org.scalatest.Matchers import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import spray.json._ import DefaultJsonProtocol._ diff --git a/tests/src/test/scala/system/rest/RestUtil.scala b/tests/src/test/scala/system/rest/RestUtil.scala index a33814cc31a..56c0f3ba161 100644 --- a/tests/src/test/scala/system/rest/RestUtil.scala +++ b/tests/src/test/scala/system/rest/RestUtil.scala @@ -20,9 +20,9 @@ package system.rest import akka.http.scaladsl.model.Uri import scala.util.Try -import com.jayway.restassured.RestAssured -import com.jayway.restassured.config.RestAssuredConfig -import com.jayway.restassured.config.SSLConfig +import io.restassured.RestAssured +import io.restassured.config.RestAssuredConfig +import io.restassured.config.SSLConfig import common.WhiskProperties import spray.json._ @@ -38,7 +38,8 @@ trait RestUtil { val sslconfig = { val inner = new SSLConfig().allowAllHostnames() val config = if (!skipKeyStore && trustStorePassword != null) { - inner.keystore("keystore", trustStorePassword) + inner.keyStore("keystore", trustStorePassword) + inner.trustStore("keystore", trustStorePassword) } else { inner.relaxedHTTPSValidation() } diff --git a/tests/src/test/scala/system/rest/SwaggerTests.scala b/tests/src/test/scala/system/rest/SwaggerTests.scala index afd754c6c7f..ab0e3171109 100644 --- a/tests/src/test/scala/system/rest/SwaggerTests.scala +++ b/tests/src/test/scala/system/rest/SwaggerTests.scala @@ -22,7 +22,7 @@ import org.scalatest.FlatSpec import org.scalatest.Matchers import org.scalatest.junit.JUnitRunner -import com.jayway.restassured.RestAssured +import io.restassured.RestAssured import common.WhiskProperties