Integration Tests: Avoid asserting on errors for permission tests (#20643)
* Added integration tests for PropertyTypeUsageService and adjusted assert in management API permissions test. * Commented or fixed management API integration tests verifying permissions where we were asserting on an error response.
This commit is contained in:
@@ -27,7 +27,7 @@ public class ExecuteActionHealthCheckControllerTests : ManagementApiUserGroupTes
|
||||
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
@@ -58,7 +58,7 @@ public class ExecuteActionHealthCheckControllerTests : ManagementApiUserGroupTes
|
||||
protected override async Task<HttpResponseMessage> ClientRequest()
|
||||
{
|
||||
HealthCheckActionRequestModel healthCheckActionRequest =
|
||||
new() { HealthCheck = new ReferenceByIdModel(_dataIntegrityHealthCheckId), ValueRequired = false };
|
||||
new() { HealthCheck = new ReferenceByIdModel(_dataIntegrityHealthCheckId), ValueRequired = false, Alias = "fixContentPaths" };
|
||||
return await Client.PostAsync(Url, JsonContent.Create(healthCheckActionRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class AllLogViewerControllerTests : ManagementApiUserGroupTestBase<AllLog
|
||||
// We get the InternalServerError for the admin because it has access, but there is no log file to view
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
@@ -11,7 +11,7 @@ public class AllMessageTemplateLogViewerControllerTests : ManagementApiUserGroup
|
||||
// We get the InternalServerError for the admin because it has access, but there is no log file to view
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
@@ -11,7 +11,7 @@ public class LogLevelCountLogViewerControllerTests : ManagementApiUserGroupTestB
|
||||
// We get the InternalServerError for the admin because it has access, but there is no log file to view
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ValidateLogFileSizeLogViewerControllerTests: ManagementApiUserGroup
|
||||
// We get the InternalServerError for the admin because it has access, but there is no log file to view
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
@@ -36,7 +36,7 @@ public class IsUsedPropertyTypeControllerTests : ManagementApiUserGroupTestBase<
|
||||
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError
|
||||
ExpectedStatusCode = HttpStatusCode.OK
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
@@ -27,7 +27,7 @@ public class InviteUserControllerTests : ManagementApiUserGroupTestBase<InviteUs
|
||||
|
||||
protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
|
||||
{
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError,
|
||||
ExpectedStatusCode = HttpStatusCode.InternalServerError, // We expect an error here because email sending is not configured in these tests.
|
||||
};
|
||||
|
||||
protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
|
||||
|
||||
Reference in New Issue
Block a user