rabbah commented on a change in pull request #2996: Rewrite WskBasicUsageTests
URL: 
https://github.com/apache/incubator-openwhisk/pull/2996#discussion_r160849454
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
 ##########
 @@ -1216,19 +734,41 @@ class WskBasicUsageTests extends TestHelpers with 
WskTestHelpers {
     assetHelper.withCleaner(wsk.action, name) { (action, _) =>
       action.create(name, file)
     }
-    retry({
-      wsk.action.list().stdout should include(s"$name private nodejs")
-    }, 5, Some(1 second))
+    retry(
+      {
+        val actionList = wsk.action.list()
+        val actions = actionList.getBodyListJsObject()
+        actions.exists(
+          action =>
+            RestResult
+              .getField(action, "name") == name && 
RestResult.getFieldJsValue(action, "publish").toString == "false"
+              && RestResult
+                .getFieldListJsObject(action, "annotations")
+                .exists(anno =>
+                  RestResult.getField(anno, "key") == "exec" && RestResult
+                    .getField(anno, "value") == "nodejs:6")) shouldBe true
+      },
+      5,
+      Some(1 second))
   }
 
   it should "create, and list a trigger with a long name" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
     val name = "x" * 70
     assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) =>
       trigger.create(name)
     }
-    retry({
-      wsk.trigger.list().stdout should include(s"$name private")
-    }, 5, Some(1 second))
+    retry(
+      {
+        val triggerList = wsk.trigger.list()
+        val triggers = triggerList.getBodyListJsObject()
+        triggers.exists(
+          trigger =>
+            RestResult.getField(trigger, "name") == name && RestResult
+              .getFieldJsValue(trigger, "publish")
+              .toString == "false") shouldBe true
+      },
+      5,
+      Some(1 second))
   }
 
   it should "create, and list a rule with a long name" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
 
 Review comment:
   and this one.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to