This commit is contained in:
2026-02-26 11:27:47 -08:00
parent 9600fc3742
commit e71584ec63

View File

@@ -1,9 +1,5 @@
using System;
using Xunit; using Xunit;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using FluentAssertions;
using System.Collections.Generic;
using System.Collections.Concurrent;
namespace raven_integration namespace raven_integration
{ {
@@ -18,7 +14,7 @@ namespace raven_integration
[Fact] [Fact]
public async Task ServerShouldNotAllowUnauthenticatedAccess() public async Task ServerShouldNotAllowUnauthenticatedAccess()
{ {
ApiResponse a = await Util.GetAsync("widget/list"); ApiResponse a = await Util.GetAsync("project/list");
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
@@ -28,7 +24,7 @@ namespace raven_integration
[Fact] [Fact]
public async Task ServerShouldNotAllowReadUnauthorizedAccess() public async Task ServerShouldNotAllowReadUnauthorizedAccess()
{ {
ApiResponse a = await Util.GetAsync("widget/listwidgets", await Util.GetTokenAsync( "OpsAdmin")); ApiResponse a = await Util.GetAsync("project/listprojects", await Util.GetTokenAsync( "OpsAdmin"));
//2004 unauthorized //2004 unauthorized
Util.ValidateErrorCodeResponse(a, 2004, 403); Util.ValidateErrorCodeResponse(a, 2004, 403);
} }
@@ -43,14 +39,14 @@ namespace raven_integration
{ {
//CREATE //CREATE
dynamic d = new JObject(); dynamic d = new JObject();
d.name = Util.Uniquify("ServerShouldNotAllowCreateUnauthorizedAccess TEST WIDGET"); d.name = Util.Uniquify("ServerShouldNotAllowCreateUnauthorizedAccess TEST PROJECT");
d.created = DateTime.Now.ToString(); d.created = DateTime.Now.ToString();
d.dollarAmount = 1.11m; d.dollarAmount = 1.11m;
d.active = true; d.active = true;
d.usertype = 1; d.usertype = 1;
//BizAdminRestricted user should not be able to create a widget, only read them //BizAdminRestricted user should not be able to create a project, only read them
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync( "BizAdminRestricted"), d.ToString()); ApiResponse a = await Util.PostAsync("project", await Util.GetTokenAsync( "BizAdminRestricted"), d.ToString());
//2004 unauthorized //2004 unauthorized
Util.ValidateErrorCodeResponse(a, 2004, 403); Util.ValidateErrorCodeResponse(a, 2004, 403);