This commit is contained in:
@@ -20,9 +20,9 @@ namespace raven_integration
|
||||
public async void ObjectLogWorks()
|
||||
{
|
||||
//CRUD a widget and confirm it logs properly
|
||||
//http://localhost:7575/api/v8.0/EventLog/UserLog?AyType=3&AyId=1
|
||||
//http://localhost:7575/api/v8.0/EventLog/ObjectLog?AyType=2&AyId=242
|
||||
//http://localhost:7575/api/v8.0/EventLog/UserLog?AyType=3&AyId=1&StartDate=2018-08-23&EndDate=2018-08-24
|
||||
//http://localhost:7575/api/v8.0/event-log/userlog?AyType=3&AyId=1
|
||||
//http://localhost:7575/api/v8.0/event-log/objectlog?AyType=2&AyId=242
|
||||
//http://localhost:7575/api/v8.0/event-log/userlog?AyType=3&AyId=1&StartDate=2018-08-23&EndDate=2018-08-24
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify("EventLog Test WIDGET");
|
||||
@@ -38,7 +38,7 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
long w2Id = r2.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
ApiResponse EventLogResponse = await Util.GetAsync($"EventLog/ObjectLog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse EventLogResponse = await Util.GetAsync($"event-log/objectlog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
|
||||
|
||||
((JArray)EventLogResponse.ObjectResponse["data"]["events"]).Count.Should().Be(1);//only one event so far
|
||||
@@ -58,7 +58,7 @@ namespace raven_integration
|
||||
w = r3.ObjectResponse["data"];
|
||||
|
||||
|
||||
EventLogResponse = await Util.GetAsync($"EventLog/ObjectLog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
EventLogResponse = await Util.GetAsync($"event-log/objectlog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
|
||||
//confirm event count, type and sort order (descending by date most recent first)
|
||||
((JArray)EventLogResponse.ObjectResponse["data"]["events"]).Count.Should().Be(2);
|
||||
@@ -83,7 +83,7 @@ namespace raven_integration
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(w.name.ToString());
|
||||
uint concurrency = PUTTestResponse.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
|
||||
EventLogResponse = await Util.GetAsync($"EventLog/ObjectLog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
EventLogResponse = await Util.GetAsync($"event-log/objectlog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
|
||||
((JArray)EventLogResponse.ObjectResponse["data"]["events"]).Count.Should().Be(4);
|
||||
//put op is the second item in the list, top item is the recent fetch
|
||||
@@ -93,8 +93,8 @@ namespace raven_integration
|
||||
EventLogResponse.ObjectResponse["data"]["events"][1]["textra"].Should().BeNullOrEmpty();
|
||||
|
||||
|
||||
//Check user log for basic accessibility UserLog?UserId=7
|
||||
EventLogResponse = await Util.GetAsync($"EventLog/UserLog?UserId={CurrentUserId}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
//Check user log for basic accessibility userlog?UserId=7
|
||||
EventLogResponse = await Util.GetAsync($"event-log/userlog?UserId={CurrentUserId}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
|
||||
((JArray)EventLogResponse.ObjectResponse["data"]["events"]).Count.Should().BeGreaterOrEqualTo(4);//just one run of the above will be 4 events plus any others from other tests
|
||||
//Not sure of any easy way to assert the User log is correct other than the count as other tests running concurrently could easily skew this
|
||||
@@ -105,7 +105,7 @@ namespace raven_integration
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//All events should be cleared up on deletion with the sole exception of the deleted event
|
||||
EventLogResponse = await Util.GetAsync($"EventLog/ObjectLog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
EventLogResponse = await Util.GetAsync($"event-log/objectlog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
|
||||
((JArray)EventLogResponse.ObjectResponse["data"]["events"]).Count.Should().Be(1);
|
||||
EventLogResponse.ObjectResponse["data"]["events"][0]["date"].Value<DateTime>().Should().BeLessThan(new TimeSpan(1, 0, 0)).Before(DateTime.UtcNow);//should be less than one hour before now
|
||||
@@ -160,7 +160,7 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
}
|
||||
|
||||
a = await Util.GetAsync($"EventLog/UserLog?UserId={UserId}&Offset=0&Limit=9", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"event-log/userlog?UserId={UserId}&Offset=0&Limit=9", await Util.GetTokenAsync("BizAdminFull"));
|
||||
((JArray)a.ObjectResponse["data"]["events"]).Count.Should().Be(9);
|
||||
//capture events, then compare to paged ones
|
||||
var eventList = ((JArray)a.ObjectResponse["data"]["events"]);
|
||||
@@ -172,7 +172,7 @@ namespace raven_integration
|
||||
);
|
||||
}
|
||||
|
||||
a = await Util.GetAsync($"EventLog/UserLog?UserId={UserId}&Offset=0&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"event-log/userlog?UserId={UserId}&Offset=0&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
((JArray)a.ObjectResponse["data"]["events"]).Count.Should().Be(3);
|
||||
var pageEventList = ((JArray)a.ObjectResponse["data"]["events"]);
|
||||
foreach (JObject o in pageEventList)
|
||||
@@ -182,7 +182,7 @@ namespace raven_integration
|
||||
);
|
||||
}
|
||||
|
||||
a = await Util.GetAsync($"EventLog/UserLog?UserId={UserId}&Offset=1&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"event-log/userlog?UserId={UserId}&Offset=1&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
((JArray)a.ObjectResponse["data"]["events"]).Count.Should().Be(3);
|
||||
pageEventList = ((JArray)a.ObjectResponse["data"]["events"]);
|
||||
foreach (JObject o in pageEventList)
|
||||
@@ -193,7 +193,7 @@ namespace raven_integration
|
||||
}
|
||||
|
||||
|
||||
a = await Util.GetAsync($"EventLog/UserLog?UserId={UserId}&Offset=2&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"event-log/userlog?UserId={UserId}&Offset=2&Limit=3", await Util.GetTokenAsync("BizAdminFull"));
|
||||
((JArray)a.ObjectResponse["data"]["events"]).Count.Should().Be(3);
|
||||
pageEventList = ((JArray)a.ObjectResponse["data"]["events"]);
|
||||
foreach (JObject o in pageEventList)
|
||||
|
||||
Reference in New Issue
Block a user