openwhisk-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-openwhisk] markusthoemmes commented on a change in pull request #4387: Make tests working in case the "provide-api-key" feature is disabled
Date Fri, 29 Mar 2019 12:14:21 GMT
markusthoemmes commented on a change in pull request #4387: Make tests working in case the
"provide-api-key" feature is disabled
URL: https://github.com/apache/incubator-openwhisk/pull/4387#discussion_r270383805
 
 

 ##########
 File path: tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala
 ##########
 @@ -450,12 +456,26 @@ class WskRestBasicUsageTests extends TestHelpers with WskTestHelpers
with WskAct
       }
 
       val action = wsk.action.get(name)
-      action.getFieldJsValue("annotations") shouldBe JsArray(
-        JsObject("key" -> JsString("web-export"), "value" -> JsBoolean(true)),
-        JsObject("key" -> JsString("raw-http"), "value" -> JsBoolean(false)),
-        JsObject("key" -> JsString("final"), "value" -> JsBoolean(true)),
-        JsObject("key" -> WhiskAction.provideApiKeyAnnotationName.toJson, "value" ->
JsBoolean(false)),
-        JsObject("key" -> JsString("exec"), "value" -> JsString("nodejs:6")))
+      action.getFieldJsValue("annotations") shouldBe (if (requireAPIKeyAnnotation) {
+                                                        JsArray(
+                                                          JsObject("key" -> JsString("web-export"),
"value" -> JsTrue),
+                                                          JsObject("key" -> JsString("raw-http"),
"value" -> JsFalse),
+                                                          JsObject("key" -> JsString("final"),
"value" -> JsTrue),
+                                                          JsObject(
+                                                            "key" -> WhiskAction.provideApiKeyAnnotationName.toJson,
+                                                            "value" -> JsFalse),
+                                                          JsObject(
+                                                            "key" -> JsString("exec"),
+                                                            "value" -> JsString("nodejs:6")))
+                                                      } else {
+                                                        JsArray(
+                                                          JsObject("key" -> JsString("web-export"),
"value" -> JsTrue),
+                                                          JsObject("key" -> JsString("raw-http"),
"value" -> JsFalse),
+                                                          JsObject("key" -> JsString("final"),
"value" -> JsTrue),
+                                                          JsObject(
+                                                            "key" -> JsString("exec"),
+                                                            "value" -> JsString("nodejs:6")))
+                                                      })
 
 Review comment:
   Please adjust the way the annotations are built to the same method as used above.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Mime
View raw message