USERGRID-1044: add optional region header functionality to most requests
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/963a0841 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/963a0841 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/963a0841 Branch: refs/heads/master Commit: 963a08417aa66eea567301e2592751d051a1a73c Parents: 06e3fa4 Author: Mike Dunker <mdun...@apigee.com> Authored: Mon Oct 19 11:07:41 2015 -0700 Committer: Mike Dunker <mdun...@apigee.com> Committed: Mon Oct 19 11:07:41 2015 -0700 ---------------------------------------------------------------------- .../org/apache/usergrid/scenarios/AuditScenarios.scala | 3 +++ .../usergrid/scenarios/EntityCollectionScenarios.scala | 11 +++++++++++ 2 files changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala ---------------------------------------------------------------------- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index bd0d007..be754f4 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -58,6 +58,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -75,6 +76,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -118,6 +120,7 @@ object AuditScenarios { http("DELETE audited entity") .delete("/${collectionName}/${uuid}") .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(extractEntityUuid(SessionVarDeletedUuid))) .exec(session => { val uuid = session(SessionVarDeletedUuid).as[String] http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/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 de95920..bc3cf8c 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 @@ -73,6 +73,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -80,6 +81,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -110,6 +112,7 @@ object EntityCollectionScenarios { http("GET entity by name (anonymous)") .get(randomEntityNameUrl()) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -117,6 +120,7 @@ object EntityCollectionScenarios { http("GET entity by name (token)") .get(randomEntityNameUrl()) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -153,6 +157,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -161,6 +166,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -207,6 +213,7 @@ object EntityCollectionScenarios { exec(http("POST load entity") .post(_ => "/" + Settings.collection) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .body(StringBody("""${entity}""")) // 200 for success, 400 if already exists .check(status.in(Seq(200)), extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified))) @@ -244,6 +251,7 @@ object EntityCollectionScenarios { http("DELETE entity") .delete("""${entityUrl}""") .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) // 200 for success, 404 if doesn't exist .check(status.in(Seq(200))) ) @@ -271,6 +279,7 @@ object EntityCollectionScenarios { http("UPDATE entity") .put("""${entityUrl}""") .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .body(StringBody(Settings.updateBody)) // 200 for success, 404 if doesn't exist .check(status.in(Seq(200))) @@ -299,6 +308,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${entityName}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200), extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified))) .exec(session => { val uuid = session(SessionVarUuid).as[String] @@ -317,6 +327,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${entityName}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified))) .exec(session => { val uuid = session(SessionVarUuid).as[String]