usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: USERGRID-1044: attempt #2 to preprocess response body
Date Tue, 27 Oct 2015 18:29:35 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1044 2778f0a0b -> 4b2d00355


USERGRID-1044: attempt #2 to preprocess response body


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/4b2d0035
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/4b2d0035
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/4b2d0035

Branch: refs/heads/USERGRID-1044
Commit: 4b2d00355e5645ab5c158b4c4f8e228037879af4
Parents: 2778f0a
Author: Mike Dunker <mdunker@apigee.com>
Authored: Tue Oct 27 11:29:16 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Tue Oct 27 11:29:16 2015 -0700

----------------------------------------------------------------------
 .../usergrid/scenarios/EntityCollectionScenarios.scala | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/4b2d0035/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
index bcdb49a..f37a2d2 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
@@ -223,15 +223,10 @@ object EntityCollectionScenarios {
         .transformResponse {
           case response if response.isReceived =>
             new ResponseWrapper(response) {
-              override val body = {
-                val contentType = response.header("content-type").getOrElse("").toLowerCase
-                if (contentType.contains("json")) {
-                  StringResponseBody(response.body.string, response.charset)
-                } else {
-                  StringResponseBody("{}", StandardCharsets.UTF_8)
-                }
-              }
-          }
+              val contentType = response.header("content-type").getOrElse("").toLowerCase
+              val bodyStr = if (contentType.contains("json")) response.body.string else "[]"
+              override val body = StringResponseBody(bodyStr, response.charset)
+            }
         }
         // 200 for success, 400 if already exists
         .check(status.saveAs(SessionVarStatus), extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified)))


Mime
View raw message