From b20d75b2322f0c4598d82fa14baf2238236158a9 Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Wed, 29 Nov 2023 16:45:25 +0000 Subject: [PATCH] [AC-1139] Removed unnecessary permissions object creation on unit tests --- .../BulkCollectionAuthorizationHandlerTests.cs | 9 --------- .../CollectionAuthorizationHandlerTests.cs | 4 ---- 2 files changed, 13 deletions(-) diff --git a/test/Api.Test/Vault/AuthorizationHandlers/BulkCollectionAuthorizationHandlerTests.cs b/test/Api.Test/Vault/AuthorizationHandlers/BulkCollectionAuthorizationHandlerTests.cs index ca578f58d..c6c2c29b0 100644 --- a/test/Api.Test/Vault/AuthorizationHandlers/BulkCollectionAuthorizationHandlerTests.cs +++ b/test/Api.Test/Vault/AuthorizationHandlers/BulkCollectionAuthorizationHandlerTests.cs @@ -32,7 +32,6 @@ public class BulkCollectionAuthorizationHandlerTests { organization.Type = userType; organization.LimitCollectionCreationDeletion = true; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { BulkCollectionOperations.Create }, @@ -142,7 +141,6 @@ public class BulkCollectionAuthorizationHandlerTests { organization.Type = userType; organization.LimitCollectionCreationDeletion = true; - organization.Permissions = new Permissions(); sutProvider.GetDependency().UserId.Returns(userId); sutProvider.GetDependency().GetOrganization(organization.Id).Returns(organization); @@ -204,7 +202,6 @@ public class BulkCollectionAuthorizationHandlerTests organization.Type = OrganizationUserType.User; organization.LimitCollectionCreationDeletion = false; - organization.Permissions = new Permissions(); sutProvider.GetDependency().UserId.Returns(actingUserId); sutProvider.GetDependency().GetOrganization(organization.Id).Returns(organization); @@ -287,7 +284,6 @@ public class BulkCollectionAuthorizationHandlerTests { organization.Type = userType; organization.LimitCollectionCreationDeletion = true; - organization.Permissions = new Permissions(); sutProvider.GetDependency().UserId.Returns(userId); sutProvider.GetDependency().GetOrganization(organization.Id).Returns(organization); @@ -349,7 +345,6 @@ public class BulkCollectionAuthorizationHandlerTests organization.Type = OrganizationUserType.User; organization.LimitCollectionCreationDeletion = false; - organization.Permissions = new Permissions(); sutProvider.GetDependency().UserId.Returns(actingUserId); sutProvider.GetDependency().GetOrganization(organization.Id).Returns(organization); @@ -430,7 +425,6 @@ public class BulkCollectionAuthorizationHandlerTests { organization.Type = userType; organization.LimitCollectionCreationDeletion = true; - organization.Permissions = new Permissions(); var operationsToTest = new[] { @@ -503,7 +497,6 @@ public class BulkCollectionAuthorizationHandlerTests var actingUserId = Guid.NewGuid(); organization.Type = OrganizationUserType.User; - organization.Permissions = new Permissions(); foreach (var c in collections) { @@ -629,7 +622,6 @@ public class BulkCollectionAuthorizationHandlerTests { organization.Type = userType; organization.LimitCollectionCreationDeletion = true; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { BulkCollectionOperations.Delete }, @@ -681,7 +673,6 @@ public class BulkCollectionAuthorizationHandlerTests var actingUserId = Guid.NewGuid(); organization.Type = OrganizationUserType.User; - organization.Permissions = new Permissions(); sutProvider.GetDependency().UserId.Returns(actingUserId); sutProvider.GetDependency().GetOrganization(organization.Id).Returns(organization); diff --git a/test/Api.Test/Vault/AuthorizationHandlers/CollectionAuthorizationHandlerTests.cs b/test/Api.Test/Vault/AuthorizationHandlers/CollectionAuthorizationHandlerTests.cs index ea10e3478..3b4a1c027 100644 --- a/test/Api.Test/Vault/AuthorizationHandlers/CollectionAuthorizationHandlerTests.cs +++ b/test/Api.Test/Vault/AuthorizationHandlers/CollectionAuthorizationHandlerTests.cs @@ -26,7 +26,6 @@ public class CollectionAuthorizationHandlerTests CurrentContextOrganization organization) { organization.Type = userType; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { CollectionOperations.ReadAll(organization.Id) }, @@ -47,7 +46,6 @@ public class CollectionAuthorizationHandlerTests SutProvider sutProvider, CurrentContextOrganization organization) { organization.Type = OrganizationUserType.User; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { CollectionOperations.ReadAll(organization.Id) }, @@ -138,7 +136,6 @@ public class CollectionAuthorizationHandlerTests CurrentContextOrganization organization) { organization.Type = userType; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { CollectionOperations.ReadAllWithAccess(organization.Id) }, @@ -159,7 +156,6 @@ public class CollectionAuthorizationHandlerTests SutProvider sutProvider, CurrentContextOrganization organization) { organization.Type = OrganizationUserType.User; - organization.Permissions = new Permissions(); var context = new AuthorizationHandlerContext( new[] { CollectionOperations.ReadAllWithAccess(organization.Id) },