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/20 19:13:14 UTC

[GitHub] csantanapr closed pull request #228: Fix failing web action tests

csantanapr closed pull request #228: Fix failing web action tests
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/228
 
 
   

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/KafkaFeedWebTests.scala b/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
index 5a426bb..421906b 100644
--- a/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
@@ -53,12 +53,12 @@ class KafkaFeedWebTests
     "authKey" -> JsString("DoesNotWork")
   )
 
-  def makePutCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
+  def makePostCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
     val response = RestAssured.given()
         .contentType("application/json\r\n")
         .config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
         .body(params.toString())
-        .put(webActionURL)
+        .post(webActionURL)
     assert(response.statusCode() == expectedCode)
     response.body.asString shouldBe expectedResult
   }
@@ -81,23 +81,23 @@ class KafkaFeedWebTests
   it should "reject post of a trigger due to missing brokers argument" in {
     val params = JsObject(completeParams.fields - "brokers")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'brokers' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'brokers' parameter.", 400)
   }
 
   it should "reject post of a trigger due to missing topic argument" in {
     val params = JsObject(completeParams.fields - "topic")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
   }
 
   it should "reject post of a trigger due to missing triggerName argument" in {
     val params = JsObject(completeParams.fields - "triggerName")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
   }
 
-  it should "reject put of a trigger when authentication fails" in {
-    makePutCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
+  it should "reject post of a trigger when authentication fails" in {
+    makePostCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
   }
 
   // it should "reject delete of a trigger that does not exist" in {
diff --git a/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala b/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
index b5e2c81..4a3354a 100644
--- a/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
@@ -53,12 +53,12 @@ class MessageHubFeedWebTests
     "authKey" -> JsString("DoesNotWork")
   )
 
-  def makePutCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
+  def makePostCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
     val response = RestAssured.given()
         .contentType("application/json\r\n")
         .config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
         .body(params.toString())
-        .put(webActionURL)
+        .post(webActionURL)
     assert(response.statusCode() == expectedCode)
     response.body.asString shouldBe expectedResult
   }
@@ -81,35 +81,35 @@ class MessageHubFeedWebTests
   it should "reject post of a trigger due to missing kafka_brokers_sasl argument" in {
     val params = JsObject(completeParams.fields - "kafka_brokers_sasl")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'kafka_brokers_sasl' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'kafka_brokers_sasl' parameter.", 400)
   }
 
   it should "reject post of a trigger due to missing topic argument" in {
     val params = JsObject(completeParams.fields - "topic")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
   }
 
   it should "reject post of a trigger due to missing triggerName argument" in {
     val params = JsObject(completeParams.fields - "triggerName")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
   }
 
   it should "reject post of a trigger due to missing user argument" in {
     val params = JsObject(completeParams.fields - "user")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'user' parameter to authenticate with Message Hub.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'user' parameter to authenticate with Message Hub.", 400)
   }
 
   it should "reject post of a trigger due to missing password argument" in {
     val params = JsObject(completeParams.fields - "password")
 
-    makePutCallWithExpectedResult(params, "You must supply a 'password' parameter to authenticate with Message Hub.", 400)
+    makePostCallWithExpectedResult(params, "You must supply a 'password' parameter to authenticate with Message Hub.", 400)
   }
 
-  it should "reject put of a trigger when authentication fails" in {
-    makePutCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
+  it should "reject post of a trigger when authentication fails" in {
+    makePostCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
   }
 
   // it should "reject delete of a trigger that does not exist" in {


 

----------------------------------------------------------------
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