You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/11/20 19:13:12 UTC

[incubator-openwhisk-package-kafka] branch master updated: Fix failing web action tests (#228)

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-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new 5919ad7  Fix failing web action tests (#228)
5919ad7 is described below

commit 5919ad7ba10cf8121893bba4ae7f3e044a6716d1
Author: Adnan Baruni <ab...@users.noreply.github.com>
AuthorDate: Mon Nov 20 13:13:10 2017 -0600

    Fix failing web action tests (#228)
    
    * fix web action tests
    
    * remove put from test description
    
    * remove print statement
---
 .../test/scala/system/packages/KafkaFeedWebTests.scala | 14 +++++++-------
 .../scala/system/packages/MessageHubFeedWebTests.scala | 18 +++++++++---------
 2 files changed, 16 insertions(+), 16 deletions(-)

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 {

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