chetanmeh 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_r269917785
##########
File path:
tests/src/test/scala/org/apache/openwhisk/core/cli/test/WskRestBasicUsageTests.scala
##########
@@ -430,13 +433,49 @@ class WskRestBasicUsageTests extends TestHelpers with
WskTestHelpers with WskAct
action.create(name, Some(TestUtils.getTestActionFilename("echo.js")),
web = Some(flag.toLowerCase))
}
- val action = wsk.action.get(name)
- action.getFieldJsValue("annotations").convertTo[Set[JsObject]] shouldBe
Set(
+ val expectedSet = Set(
JsObject("key" -> JsString("exec"), "value" -> JsString("nodejs:6")),
- JsObject("key" -> WhiskAction.provideApiKeyAnnotationName.toJson,
"value" -> JsBoolean(false)),
JsObject("key" -> JsString("web-export"), "value" ->
JsBoolean(webEnabled || rawEnabled)),
JsObject("key" -> JsString("raw-http"), "value" ->
JsBoolean(rawEnabled)),
JsObject("key" -> JsString("final"), "value" -> JsBoolean(webEnabled
|| rawEnabled)))
+
+ val action = wsk.action.get(name)
+ action.getFieldJsValue("annotations").convertTo[Set[JsObject]] shouldBe
(if (requireAPIKeyAnnotation) {
Review comment:
This is definitely better approach! +1
----------------------------------------------------------------
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