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 56fc1c5  Move Feed Update Test (#259)
56fc1c5 is described below

commit 56fc1c566568e3ee33d0c0dedadfe48c617502e2
Author: James Dubee <jwdu...@us.ibm.com>
AuthorDate: Tue Mar 6 05:24:42 2018 -0500

    Move Feed Update Test (#259)
---
 .../test/scala/system/health/BasicHealthTest.scala | 84 ----------------------
 .../system/packages/MessageHubFeedTests.scala      | 84 ++++++++++++++++++++++
 2 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/tests/src/test/scala/system/health/BasicHealthTest.scala 
b/tests/src/test/scala/system/health/BasicHealthTest.scala
index 139ed21..c80458c 100644
--- a/tests/src/test/scala/system/health/BasicHealthTest.scala
+++ b/tests/src/test/scala/system/health/BasicHealthTest.scala
@@ -249,88 +249,4 @@ class BasicHealthTest
           }
       }
   }
-
-  it should "correctly update isJSONData, isBinaryValue, and isBinaryKey" in 
withAssetCleaner(wskprops) {
-    val currentTime = s"${System.currentTimeMillis}"
-
-    (wp, assetHelper) =>
-      val triggerName = s"/_/dummyMessageHubTrigger-$currentTime"
-      println(s"Creating trigger $triggerName")
-
-      val username = kafkaUtils.getAsJson("user")
-      val password = kafkaUtils.getAsJson("password")
-      val admin_url = kafkaUtils.getAsJson("kafka_admin_url")
-      val brokers = kafkaUtils.getAsJson("brokers")
-
-      val feedCreationResult = assetHelper.withCleaner(wsk.trigger, 
triggerName) {
-        (trigger, _) =>
-          trigger.create(triggerName, feed = Some(actionName), parameters = 
Map(
-            "user" -> username,
-            "password" -> password,
-            "api_key" -> kafkaUtils.getAsJson("api_key"),
-            "kafka_admin_url" -> admin_url,
-            "kafka_brokers_sasl" -> brokers,
-            "topic" -> topic.toJson,
-            "isJSONData" -> true.toJson,
-            "isBinaryKey" -> false.toJson,
-            "isBinaryValue" -> false.toJson
-          ))
-      }
-
-      withActivation(wsk.activation, feedCreationResult, initialWait = 5 
seconds, totalWait = 60 seconds) {
-        _.response.success shouldBe true
-      }
-
-      val readRunResult = wsk.action.invoke(actionName, parameters = Map(
-        "triggerName" -> triggerName.toJson,
-        "lifecycleEvent" -> "READ".toJson,
-        "authKey" -> wp.authKey.toJson
-      ))
-
-      withActivation(wsk.activation, readRunResult) {
-        activation =>
-          activation.response.success shouldBe true
-
-          inside (activation.response.result) {
-            case Some(result) =>
-              val config = 
result.getFields("config").head.asInstanceOf[JsObject].fields
-              config should contain("isBinaryKey" -> false.toJson)
-              config should contain("isBinaryValue" -> false.toJson)
-              config should contain("isJSONData" -> true.toJson)
-          }
-      }
-
-      val updateRunResult = wsk.action.invoke(actionName, parameters = Map(
-        "triggerName" -> triggerName.toJson,
-        "lifecycleEvent" -> "UPDATE".toJson,
-        "authKey" -> wp.authKey.toJson,
-        "isBinaryValue" -> true.toJson,
-        "isBinaryKey" -> true.toJson,
-        "isJSONData" -> false.toJson
-      ))
-
-      withActivation(wsk.activation, updateRunResult) {
-        activation =>
-          activation.response.success shouldBe true
-      }
-
-      val run = wsk.action.invoke(actionName, parameters = Map(
-        "triggerName" -> triggerName.toJson,
-        "lifecycleEvent" -> "READ".toJson,
-        "authKey" -> wp.authKey.toJson
-      ))
-
-      withActivation(wsk.activation, run) {
-        activation =>
-          activation.response.success shouldBe true
-
-          inside (activation.response.result) {
-            case Some(result) =>
-              val config = 
result.getFields("config").head.asInstanceOf[JsObject].fields
-              config should contain("isBinaryKey" -> true.toJson)
-              config should contain("isBinaryValue" -> true.toJson)
-              config should contain("isJSONData" -> false.toJson)
-          }
-      }
-  }
 }
diff --git a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala 
b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
index 1b8db83..f2e6180 100644
--- a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
@@ -384,6 +384,90 @@ class MessageHubFeedTests
       }
   }
 
+  it should "correctly update isJSONData, isBinaryValue, and isBinaryKey" in 
withAssetCleaner(wskprops) {
+    val currentTime = s"${System.currentTimeMillis}"
+
+    (wp, assetHelper) =>
+      val triggerName = s"/_/dummyMessageHubTrigger-$currentTime"
+      println(s"Creating trigger $triggerName")
+
+      val username = kafkaUtils.getAsJson("user")
+      val password = kafkaUtils.getAsJson("password")
+      val admin_url = kafkaUtils.getAsJson("kafka_admin_url")
+      val brokers = kafkaUtils.getAsJson("brokers")
+
+      val feedCreationResult = assetHelper.withCleaner(wsk.trigger, 
triggerName) {
+        (trigger, _) =>
+          trigger.create(triggerName, feed = Some(actionName), parameters = 
Map(
+            "user" -> username,
+            "password" -> password,
+            "api_key" -> kafkaUtils.getAsJson("api_key"),
+            "kafka_admin_url" -> admin_url,
+            "kafka_brokers_sasl" -> brokers,
+            "topic" -> topic.toJson,
+            "isJSONData" -> true.toJson,
+            "isBinaryKey" -> false.toJson,
+            "isBinaryValue" -> false.toJson
+          ))
+      }
+
+      withActivation(wsk.activation, feedCreationResult, initialWait = 5 
seconds, totalWait = 60 seconds) {
+        _.response.success shouldBe true
+      }
+
+      val readRunResult = wsk.action.invoke(actionName, parameters = Map(
+        "triggerName" -> triggerName.toJson,
+        "lifecycleEvent" -> "READ".toJson,
+        "authKey" -> wp.authKey.toJson
+      ))
+
+      withActivation(wsk.activation, readRunResult) {
+        activation =>
+          activation.response.success shouldBe true
+
+          inside (activation.response.result) {
+            case Some(result) =>
+              val config = 
result.getFields("config").head.asInstanceOf[JsObject].fields
+              config should contain("isBinaryKey" -> false.toJson)
+              config should contain("isBinaryValue" -> false.toJson)
+              config should contain("isJSONData" -> true.toJson)
+          }
+      }
+
+      val updateRunResult = wsk.action.invoke(actionName, parameters = Map(
+        "triggerName" -> triggerName.toJson,
+        "lifecycleEvent" -> "UPDATE".toJson,
+        "authKey" -> wp.authKey.toJson,
+        "isBinaryValue" -> true.toJson,
+        "isBinaryKey" -> true.toJson,
+        "isJSONData" -> false.toJson
+      ))
+
+      withActivation(wsk.activation, updateRunResult) {
+        activation =>
+          activation.response.success shouldBe true
+      }
+
+      val run = wsk.action.invoke(actionName, parameters = Map(
+        "triggerName" -> triggerName.toJson,
+        "lifecycleEvent" -> "READ".toJson,
+        "authKey" -> wp.authKey.toJson
+      ))
+
+      withActivation(wsk.activation, run) {
+        activation =>
+          activation.response.success shouldBe true
+
+          inside (activation.response.result) {
+            case Some(result) =>
+              val config = 
result.getFields("config").head.asInstanceOf[JsObject].fields
+              config should contain("isBinaryKey" -> true.toJson)
+              config should contain("isBinaryValue" -> true.toJson)
+              config should contain("isJSONData" -> false.toJson)
+          }
+      }
+  }
+
   it should "fire a trigger when a message is posted to message hub before and 
after update" in withAssetCleaner(wskprops) {
     val currentTime = s"${System.currentTimeMillis}"
 

-- 
To stop receiving notification emails like this one, please contact
csantan...@apache.org.

Reply via email to