From 49702e2d7ce33c052be74b0b9988286d7d2cfe05 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 20 May 2019 22:07:36 +0000 Subject: [PATCH] --- EventLog/EventLog.cs | 2 +- Locale/Locale.cs | 2 +- Search/SearchOps.cs | 12 ++++++------ User/UserCrud.cs | 23 +++++++++-------------- User/UserOptionsRu.cs | 2 +- Widget/WidgetCrud.cs | 4 ++-- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/EventLog/EventLog.cs b/EventLog/EventLog.cs index 117a29c..8d8a15f 100644 --- a/EventLog/EventLog.cs +++ b/EventLog/EventLog.cs @@ -75,7 +75,7 @@ namespace raven_integration //update w2id w.name = Util.Uniquify("UPDATED VIA PUT EVENTLOG TEST WIDGET"); - w.OwnerId = 1; + w.UserId = 1; w.concurrencyToken = r2.ObjectResponse["data"]["concurrencyToken"].Value(); ApiResponse PUTTestResponse = await Util.PutAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"), w.ToString()); Util.ValidateHTTPStatusCode(PUTTestResponse, 200); diff --git a/Locale/Locale.cs b/Locale/Locale.cs index b9f57fc..3726a21 100644 --- a/Locale/Locale.cs +++ b/Locale/Locale.cs @@ -140,7 +140,7 @@ namespace raven_integration var Password = Util.Uniquify("PASSWORD"); dynamic DUSER = new JObject(); DUSER.name = Util.Uniquify("LocaleUpdateSubsetTestUser"); - DUSER.ownerId = 1L; + DUSER.active = true; DUSER.login = Login; DUSER.password = Password; diff --git a/Search/SearchOps.cs b/Search/SearchOps.cs index 04da074..aa8d156 100644 --- a/Search/SearchOps.cs +++ b/Search/SearchOps.cs @@ -35,7 +35,7 @@ namespace raven_integration D.name = Util.Uniquify("Search NAME DOGS simple Test User"); D.customFields = Util.GenerateCustomFieldsJsonString("Meh1"); D.notes = "This user has the match in it's name"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -52,7 +52,7 @@ namespace raven_integration D.name = Util.Uniquify("Search NOTES Test User"); D.customFields = Util.GenerateCustomFieldsJsonString("Meh1"); D.notes = "This user has the match simple dogs in its notes"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -188,7 +188,7 @@ namespace raven_integration D = new JObject(); D.name = Util.Uniquify("Wildcard startswith search NAME happy goose Test User"); D.notes = "This user has the match in it's name"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -251,7 +251,7 @@ namespace raven_integration D = new JObject(); D.name = Util.Uniquify("Wildcard endswith search NAME goose exact Test User"); D.notes = "This user has the match in it's name"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -316,7 +316,7 @@ namespace raven_integration D = new JObject(); D.name = Util.Uniquify("Wildcard contains search NAME goose elcastro Test User"); D.notes = "This user has the match in it's name"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -414,7 +414,7 @@ namespace raven_integration D = new JObject(); D.name = Util.Uniquify("Wildcard contains search NAME elementary aardvark Test User"); D.notes = "This user has the match in it's name but no tag match"; - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); diff --git a/User/UserCrud.cs b/User/UserCrud.cs index a5590ba..930604d 100644 --- a/User/UserCrud.cs +++ b/User/UserCrud.cs @@ -19,7 +19,7 @@ namespace raven_integration //CREATE dynamic D1 = new JObject(); D1.name = Util.Uniquify("First Test User"); - D1.ownerId = 1L; + D1.active = true; D1.login = Util.Uniquify("LOGIN"); D1.password = Util.Uniquify("PASSWORD"); @@ -34,7 +34,7 @@ namespace raven_integration dynamic D2 = new JObject(); D2.name = Util.Uniquify("Second Test User"); - D2.ownerId = 1L; + D2.active = true; D2.login = Util.Uniquify("LOGIN"); D2.password = Util.Uniquify("PASSWORD"); @@ -60,8 +60,7 @@ namespace raven_integration //PUT //update w2id - D2.name = Util.Uniquify("UPDATED VIA PUT SECOND TEST User"); - D2.OwnerId = 1; + D2.name = Util.Uniquify("UPDATED VIA PUT SECOND TEST User"); D2.concurrencyToken = R2.ObjectResponse["data"]["concurrencyToken"].Value(); ApiResponse PUTTestResponse = await Util.PutAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString()); Util.ValidateHTTPStatusCode(PUTTestResponse, 200); @@ -135,7 +134,7 @@ namespace raven_integration //CREATE dynamic D = new JObject(); D.name = Util.Uniquify("PutConcurrencyViolationShouldFail"); - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -168,7 +167,7 @@ namespace raven_integration //CREATE dynamic D = new JObject(); D.name = Util.Uniquify("PatchConcurrencyViolationShouldFail"); - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -200,7 +199,7 @@ namespace raven_integration //CREATE dynamic D = new JObject(); D.name = Util.Uniquify("DisallowedPatchAttemptsShouldFail"); - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -219,11 +218,7 @@ namespace raven_integration ApiResponse PATCHTestResponse = await Util.PatchAsync("User/" + w2Id.ToString() + "/" + (OriginalConcurrencyToken - 1).ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), patchJson); Util.ValidateErrorCodeResponse(PATCHTestResponse, 2200, 400); - //PATCH attempt on OwnerId - patchJson = "[{\"value\": \"0\",\"path\": \"/ownerid\",\"op\": \"replace\"}]"; - PATCHTestResponse = await Util.PatchAsync("User/" + w2Id.ToString() + "/" + (OriginalConcurrencyToken - 1).ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), patchJson); - Util.ValidateErrorCodeResponse(PATCHTestResponse, 2200, 400); - + //PATCH attempt add field patchJson = "[{\"value\": \"0\",\"path\": \"/bogus\",\"op\": \"add\"}]"; PATCHTestResponse = await Util.PatchAsync("User/" + w2Id.ToString() + "/" + (OriginalConcurrencyToken - 1).ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), patchJson); @@ -245,7 +240,7 @@ namespace raven_integration //CREATE dynamic D = new JObject(); D.name = Util.Uniquify("PatchPasswordShouldWork"); - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); @@ -290,7 +285,7 @@ namespace raven_integration //CREATE dynamic D = new JObject(); D.name = Util.Uniquify("PutPasswordShouldWork"); - D.ownerId = 1L; + D.active = true; D.login = Util.Uniquify("LOGIN"); D.password = Util.Uniquify("PASSWORD"); diff --git a/User/UserOptionsRu.cs b/User/UserOptionsRu.cs index 841963e..647ad02 100644 --- a/User/UserOptionsRu.cs +++ b/User/UserOptionsRu.cs @@ -19,7 +19,7 @@ namespace raven_integration //CREATE a user dynamic D1 = new JObject(); D1.name = Util.Uniquify("Test UserOptions User"); - D1.ownerId = 1L; + D1.active = true; D1.login = Util.Uniquify("LOGIN"); D1.password = Util.Uniquify("PASSWORD"); diff --git a/Widget/WidgetCrud.cs b/Widget/WidgetCrud.cs index a1580f5..621e121 100644 --- a/Widget/WidgetCrud.cs +++ b/Widget/WidgetCrud.cs @@ -85,7 +85,7 @@ namespace raven_integration //update w2id w2.name = Util.Uniquify("UPDATED VIA PUT SECOND TEST WIDGET"); - w2.OwnerId = 1; + w2.concurrencyToken = r2.ObjectResponse["data"]["concurrencyToken"].Value(); ApiResponse PUTTestResponse = await Util.PutAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString()); Util.ValidateHTTPStatusCode(PUTTestResponse, 200); @@ -201,7 +201,7 @@ namespace raven_integration //PUT w2.name = Util.Uniquify("PutConcurrencyViolationShouldFail UPDATE VIA PUT "); - w2.OwnerId = 1; + w2.concurrencyToken = OriginalConcurrencyToken - 1;//bad token ApiResponse PUTTestResponse = await Util.PutAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString()); Util.ValidateConcurrencyError(PUTTestResponse);