This commit is contained in:
@@ -26,7 +26,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: The quick brown and simple fox jumped over the six lazy dogs!";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace raven_integration
|
||||
|
||||
D.userType = 3;//non scheduleable
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace raven_integration
|
||||
|
||||
D.userType = 3;//non scheduleable
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This Widget matches in name";
|
||||
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This Widget should not be returned in the search as it only contains a single keyword in the name not both";
|
||||
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchNothingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -160,7 +160,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in notes: The quick brown and hapless goose";
|
||||
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -224,7 +224,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: react to the goose";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -290,7 +290,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: broadcasting to the goose";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -340,7 +340,7 @@ namespace raven_integration
|
||||
|
||||
//Ensure excerpt works and contains the search phrase
|
||||
// /Search/Info/2/1?phrase=we&max=200
|
||||
a = await Util.GetAsync($"search/Info/2/{MatchWidgetInNotesId}?phrase={TEST_SEARCH_PHRASE}&max=200", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"search/Info/2/{MatchWidgetInNotesId}?phrase={TEST_SEARCH_PHRASE}&max=200", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[0]);
|
||||
a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[1]);
|
||||
@@ -356,7 +356,7 @@ namespace raven_integration
|
||||
// //CREATE A TAG
|
||||
// dynamic D = new JObject();
|
||||
// D.name = Util.Uniquify("TAGSEARCH");
|
||||
// ApiResponse a = await Util.PostAsync("Tag", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
// ApiResponse a = await Util.PostAsync("Tag", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// long TagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in notes and tag: elementary my dear aardvark";
|
||||
D.tags = TagsArray;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -395,7 +395,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in tag but no search phrase";
|
||||
D.tags = TagsArray;
|
||||
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long NoPhraseMatchWidgetInTagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -414,7 +414,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -466,7 +466,7 @@ namespace raven_integration
|
||||
|
||||
var watch = new System.Diagnostics.Stopwatch();
|
||||
watch.Start();
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
watch.Stop();
|
||||
|
||||
var TimeToSearch = watch.ElapsedMilliseconds;
|
||||
@@ -508,7 +508,7 @@ namespace raven_integration
|
||||
|
||||
var watch = new System.Diagnostics.Stopwatch();
|
||||
watch.Start();
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
watch.Stop();
|
||||
|
||||
var TimeToSearch = watch.ElapsedMilliseconds;
|
||||
@@ -539,7 +539,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "Test for serial number search";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInSerialId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
var MatchWidgetSerial = a.ObjectResponse["data"]["serial"].Value<uint>();
|
||||
@@ -554,7 +554,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -619,7 +619,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in custom field";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -631,7 +631,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -650,7 +650,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
|
||||
//Now delete the newly created one so the list doesn't build up and prevent this test from working in big runs...
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + MatchingWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + MatchingWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
d.usertype = 1;
|
||||
d.notes = $"This record will match in notes: {TEST_SEARCH_PHRASE} there";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WidgetId = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -682,16 +682,16 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
SearchParameters.phrase = TEST_SEARCH_PHRASE;
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//Now validate the return list (should be only one as it's super unique)
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(1);
|
||||
|
||||
//Now delete the widget and re-run the search
|
||||
a = await Util.DeleteAsync("widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + WidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//Now validate the return list (should be only one as it's super unique)
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0);
|
||||
|
||||
Reference in New Issue
Block a user