dubeejw commented on a change in pull request #2621: Replace the test cases 
with REST implementation
URL: 
https://github.com/apache/incubator-openwhisk/pull/2621#discussion_r137960620
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskRuleTests.scala
 ##########
 @@ -368,25 +369,32 @@ class WskRuleTests
                             logs should contain theSameElementsAs expectedLogs
                     }
             }
-    }
+    }*/
 
     it should "disable a rule and check its status is displayed when listed" 
in withAssetCleaner(wskprops) {
         (wp, assetHelper) =>
             val ruleName = withTimestamp("ruleDisable")
-            val ruleName2 = withTimestamp("ruleEnable")
+            val ruleNameEnable = withTimestamp("ruleEnable")
             val triggerName = withTimestamp("ruleDisableTrigger")
             val actionName = withTimestamp("ruleDisableAction")
 
             ruleSetup(Seq(
                 (ruleName, triggerName, (actionName, actionName, 
defaultAction)),
-                (ruleName2, triggerName, (actionName, actionName, 
defaultAction))),
+                (ruleNameEnable, triggerName, (actionName, actionName, 
defaultAction))),
                 assetHelper)
 
             wsk.rule.disable(ruleName)
-            val listOutput = wsk.rule.list().stdout.lines
-            listOutput.find(_.contains(ruleName2)).get should 
(include(ruleName2) and include("active"))
-            listOutput.find(_.contains(ruleName)).get should 
(include(ruleName) and include("inactive"))
-            wsk.rule.list().stdout should not include ("Unknown")
+            val ruleList = wsk.rule.list()
+            verifyRuleList(ruleList, ruleNameEnable, ruleName)
     }
 
+    def verifyRuleList(ruleListResult: RunResult, ruleNameEnable: String, 
ruleName: String) = {
+        val ruleList = ruleListResult.stdout
+        val listOutput = ruleList.lines
+        listOutput.find(_.contains(ruleNameEnable)).get should 
(include(ruleNameEnable) and include("active"))
+        listOutput.find(_.contains(ruleName)).get should (include(ruleName) 
and include("inactive"))
+        ruleList should not include ("Unknown")
+    }
 }
+
 
 Review comment:
   Remove comment.
 
----------------------------------------------------------------
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