You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/09/14 00:16:55 UTC

[GitHub] dubeejw commented on a change in pull request #2741: Display content-type in __ow_headers for web actions

dubeejw commented on a change in pull request #2741: Display content-type in __ow_headers for web actions
URL: https://github.com/apache/incubator-openwhisk/pull/2741#discussion_r138771339
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/controller/test/WebActionsApiTests.scala
 ##########
 @@ -1430,17 +1439,19 @@ trait WebActionsApiTests extends ControllerTestCommon with BeforeAndAfterEach wi
       invocationsAllowed = 1
 
       val queryString = "key1=value1&key2=value2"
-      Post(s"$testRoutePath/$systemId/proxy/raw_export_c.json?$queryString", str) ~> addHeader(
-        "Content-type",
-        MediaTypes.`application/json`.value) ~> Route.seal(routes(creds)) ~> check {
+      Post(
+        s"$testRoutePath/$systemId/proxy/raw_export_c.json?$queryString",
+        HttpEntity(ContentTypes.`application/json`, str)) ~> Route.seal(routes(creds)) ~> check {
         status should be(OK)
         val response = responseAs[JsObject]
         response shouldBe JsObject(
           "pkg" -> s"$systemId/proxy".toJson,
           "action" -> "raw_export_c".toJson,
           "content" -> metaPayload(
             Post.method.name.toLowerCase,
-            Map(webApiDirectives.body -> str.toJson, webApiDirectives.query -> queryString.toJson).toJson.asJsObject,
 
 Review comment:
   I replicated the test manually using the CLI without using the web action changes in this PR. The body is actually Base64 encoded in the web action response. This test expected the body to be a JSON string instead. After changing the POST request here to use an `HttpEntity`, the body was encoded just like in my manual testing.
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services