You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/11/19 22:49:30 UTC

[GitHub] csantanapr closed pull request #112: update tests that use "put" for trigger creation to now use "post"

csantanapr closed pull request #112: update tests that use "put" for trigger creation to now use "post"
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/112
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/system/packages/AlarmsFeedWebTests.scala b/tests/src/test/scala/system/packages/AlarmsFeedWebTests.scala
index a23b847..a1f3060 100644
--- a/tests/src/test/scala/system/packages/AlarmsFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/AlarmsFeedWebTests.scala
@@ -54,24 +54,24 @@ class AlarmsFeedWebTests
     it should "reject put of a trigger due to missing triggerName argument" in {
         val params = JsObject(originalParams.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 cron argument" in {
         val params = JsObject(originalParams.fields - "cron")
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("alarms trigger feed is missing the cron parameter")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("alarms trigger feed is missing the cron parameter")), 400)
     }
 
     it should "reject put of a trigger due to invalid cron argument" in {
         val params = JsObject(originalParams.fields + ("cron" -> JsString("***")))
 
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("cron pattern '***' is not valid")), 400)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("cron pattern '***' is not valid")), 400)
     }
 
     it should "reject put of a trigger when authentication fails" in {
         val params = JsObject(originalParams.fields + ("cron" -> JsString("* * * * *")))
-        makePutCallWithExpectedResult(params, JsObject("error" -> JsString("Trigger authentication request failed.")), 401)
+        makePostCallWithExpectedResult(params, JsObject("error" -> JsString("Trigger authentication request failed.")), 401)
     }
 
     it should "reject delete of a trigger due to missing triggerName argument" in {
@@ -84,12 +84,12 @@ class AlarmsFeedWebTests
         makeDeleteCallWithExpectedResult(originalParams, 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/AlarmsMultiWorkersTests.scala b/tests/src/test/scala/system/packages/AlarmsMultiWorkersTests.scala
index 210b60b..83e4f6d 100644
--- a/tests/src/test/scala/system/packages/AlarmsMultiWorkersTests.scala
+++ b/tests/src/test/scala/system/packages/AlarmsMultiWorkersTests.scala
@@ -72,13 +72,13 @@ class AlarmsMultiWorkersTests 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}alarmservice"
                 val documents = getAllDocs(dbName)
@@ -99,12 +99,12 @@ class AlarmsMultiWorkersTests 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)
     }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services