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_r270407097
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskRestBasicTests.scala
 ##########
 @@ -444,16 +480,36 @@ class WskRestBasicTests extends TestHelpers with 
WskTestHelpers with WskActorSys
 
     result.getField("name") shouldBe name
     result.getField("namespace") shouldBe ns
+
     val annos = result.getFieldJsValue("annotations")
-    annos shouldBe JsArray(
-      JsObject("key" -> JsString("description"), "value" -> JsString("Action 
description")),
-      JsObject(
-        "key" -> JsString("parameters"),
-        "value" -> JsArray(
-          JsObject("name" -> JsString("paramName1"), "description" -> 
JsString("Parameter description 1")),
-          JsObject("name" -> JsString("paramName2"), "description" -> 
JsString("Parameter description 2")))),
-      JsObject("key" -> WhiskAction.provideApiKeyAnnotationName.toJson, 
"value" -> JsBoolean(false)),
-      JsObject("key" -> JsString("exec"), "value" -> JsString("nodejs:6")))
+    annos shouldBe (if (requireAPIKeyAnnotation) {
+                      JsArray(
+                        JsObject("key" -> JsString("description"), "value" -> 
JsString("Action description")),
+                        JsObject(
+                          "key" -> JsString("parameters"),
+                          "value" -> JsArray(
+                            JsObject(
+                              "name" -> JsString("paramName1"),
+                              "description" -> JsString("Parameter description 
1")),
+                            JsObject(
+                              "name" -> JsString("paramName2"),
+                              "description" -> JsString("Parameter description 
2")))),
+                        JsObject("key" -> 
WhiskAction.provideApiKeyAnnotationName.toJson, "value" -> JsBoolean(false)),
+                        JsObject("key" -> JsString("exec"), "value" -> 
JsString("nodejs:6")))
+                    } else {
+                      JsArray(
+                        JsObject("key" -> JsString("description"), "value" -> 
JsString("Action description")),
+                        JsObject(
+                          "key" -> JsString("parameters"),
+                          "value" -> JsArray(
+                            JsObject(
+                              "name" -> JsString("paramName1"),
+                              "description" -> JsString("Parameter description 
1")),
+                            JsObject(
+                              "name" -> JsString("paramName2"),
+                              "description" -> JsString("Parameter description 
2")))),
+                        JsObject("key" -> JsString("exec"), "value" -> 
JsString("nodejs:6")))
 
 Review comment:
   I think the annotations comment applies to all the instances you touched 
annotation lists.

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


With regards,
Apache Git Services

Reply via email to