openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-package-cloudant] branch master updated: update tests that use put on creation to now use post (#147)
Date Sun, 19 Nov 2017 22:49:03 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-cloudant.git


The following commit(s) were added to refs/heads/master by this push:
     new d484a9f  update tests that use put on creation to now use post (#147)
d484a9f is described below

commit d484a9f8d8e72ad8b7d376088394e54b51ec6d23
Author: Jason Peterson <jasonpet@us.ibm.com>
AuthorDate: Sun Nov 19 17:49:01 2017 -0500

    update tests that use put on creation to now use post (#147)
---
 .../scala/system/packages/CloudantFeedWebTests.scala     | 16 ++++++++--------
 .../system/packages/CloudantMultiWorkersTests.scala      |  8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/src/test/scala/system/packages/CloudantFeedWebTests.scala b/tests/src/test/scala/system/packages/CloudantFeedWebTests.scala
index 46aff32..b1dc009 100644
--- a/tests/src/test/scala/system/packages/CloudantFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/CloudantFeedWebTests.scala
@@ -58,36 +58,36 @@ class CloudantFeedWebTests
     it should "reject put of a trigger due to missing triggerName argument" in {
         val params = JsObject(requiredParams.fields - "triggerName")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("no trigger
name parameter was provided")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("no trigger
name parameter was provided")), 400)
     }
 
     it should "reject put of a trigger due to missing host argument" in {
         val params = JsObject(requiredParams.fields - "host")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant trigger
feed: missing host parameter")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant
trigger feed: missing host parameter")), 400)
     }
 
     it should "reject put of a trigger due to missing username argument" in {
         val params = JsObject(requiredParams.fields - "username")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant trigger
feed: missing username parameter")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant
trigger feed: missing username parameter")), 400)
     }
 
     it should "reject put of a trigger due to missing password argument" in {
         val params = JsObject(requiredParams.fields - "password")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant trigger
feed: missing password parameter")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant
trigger feed: missing password parameter")), 400)
     }
 
     it should "reject put of a trigger due to missing dbname argument" in {
         val params = JsObject(requiredParams.fields - "dbname")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant trigger
feed: missing dbname parameter")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("cloudant
trigger feed: missing dbname parameter")), 400)
     }
 
     it should "reject put of a trigger when authentication fails" in {
 
-        makePutCallWithExpectedResult(requiredParams, JsObject("error" -> JsString("Trigger
authentication request failed.")), 401)
+        makePostCallWithExpectedResult(requiredParams, JsObject("error" -> JsString("Trigger
authentication request failed.")), 401)
     }
 
     it should "reject delete of a trigger due to missing triggerName argument" in {
@@ -100,12 +100,12 @@ class CloudantFeedWebTests
         makeDeleteCallWithExpectedResult(requiredParams, JsObject("error" -> JsString("Trigger
authentication request failed.")), 401)
     }
 
-    def makePutCallWithExpectedResult(params: JsObject, expectedResult: JsObject, expectedCode:
Int) = {
+    def makePostCallWithExpectedResult(params: JsObject, expectedResult: JsObject, expectedCode:
Int) = {
         val response = RestAssured.given()
                 .contentType(ContentType.JSON)
                 .config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
                 .body(params.toString())
-                .put(webActionURL)
+                .post(webActionURL)
         assert(response.statusCode() == expectedCode)
         response.body.asString.parseJson.asJsObject shouldBe expectedResult
     }
diff --git a/tests/src/test/scala/system/packages/CloudantMultiWorkersTests.scala b/tests/src/test/scala/system/packages/CloudantMultiWorkersTests.scala
index 7acfddb..6280d25 100644
--- a/tests/src/test/scala/system/packages/CloudantMultiWorkersTests.scala
+++ b/tests/src/test/scala/system/packages/CloudantMultiWorkersTests.scala
@@ -82,13 +82,13 @@ class CloudantMultiWorkersTests extends FlatSpec
                 wsk.trigger.create(worker10Trigger)
 
                 //create trigger feed and assign to worker10
-                makePutCallWithExpectedResult(worker10Params, 200)
+                makePostCallWithExpectedResult(worker10Params, 200)
 
                 wsk.trigger.create(worker11Trigger)
 
                 //create trigger feed and assign to worker10 or worker11
                 //the one with the least assigned triggers will be chosen
-                makePutCallWithExpectedResult(worker11Params, 200)
+                makePostCallWithExpectedResult(worker11Params, 200)
 
                 val dbName = s"${dbPrefix}cloudanttrigger"
                 val documents = getAllDocs(dbName)
@@ -111,12 +111,12 @@ class CloudantMultiWorkersTests extends FlatSpec
             }
     }
 
-    def makePutCallWithExpectedResult(params: JsObject, expectedCode: Int) = {
+    def makePostCallWithExpectedResult(params: JsObject, expectedCode: Int) = {
         val response = RestAssured.given()
                 .contentType(ContentType.JSON)
                 .config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
                 .body(params.toString())
-                .put(webActionURL)
+                .post(webActionURL)
         assert(response.statusCode() == expectedCode)
     }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message