mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[AC-1330] [AC-1816] Deprecate AccessAll in CollectionCipher sprocs (#3480)
This commit is contained in:
@ -116,7 +116,7 @@ public class SyncControllerTests
|
||||
|
||||
// Returns for methods only called if we have enabled orgs
|
||||
collectionRepository.GetManyByUserIdAsync(user.Id).Returns(collections);
|
||||
collectionCipherRepository.GetManyByUserIdAsync(user.Id).Returns(new List<CollectionCipher>());
|
||||
collectionCipherRepository.GetManyByUserIdAsync(user.Id, Arg.Any<bool>()).Returns(new List<CollectionCipher>());
|
||||
|
||||
// Back to standard test setup
|
||||
userService.TwoFactorIsEnabledAsync(user).Returns(false);
|
||||
@ -281,7 +281,7 @@ public class SyncControllerTests
|
||||
|
||||
// Returns for methods only called if we have enabled orgs
|
||||
collectionRepository.GetManyByUserIdAsync(user.Id).Returns(collections);
|
||||
collectionCipherRepository.GetManyByUserIdAsync(user.Id).Returns(new List<CollectionCipher>());
|
||||
collectionCipherRepository.GetManyByUserIdAsync(user.Id, Arg.Any<bool>()).Returns(new List<CollectionCipher>());
|
||||
|
||||
// Back to standard test setup
|
||||
userService.TwoFactorIsEnabledAsync(user).Returns(false);
|
||||
@ -346,7 +346,7 @@ public class SyncControllerTests
|
||||
await collectionRepository.ReceivedWithAnyArgs(1)
|
||||
.GetManyByUserIdAsync(default);
|
||||
await collectionCipherRepository.ReceivedWithAnyArgs(1)
|
||||
.GetManyByUserIdAsync(default);
|
||||
.GetManyByUserIdAsync(default, default);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -354,7 +354,7 @@ public class SyncControllerTests
|
||||
await collectionRepository.ReceivedWithAnyArgs(0)
|
||||
.GetManyByUserIdAsync(default);
|
||||
await collectionCipherRepository.ReceivedWithAnyArgs(0)
|
||||
.GetManyByUserIdAsync(default);
|
||||
.GetManyByUserIdAsync(default, default);
|
||||
}
|
||||
|
||||
await userService.ReceivedWithAnyArgs(1)
|
||||
|
@ -432,7 +432,7 @@ public class CipherServiceTests
|
||||
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
|
||||
var attachmentStorageService = sutProvider.GetDependency<IAttachmentStorageService>();
|
||||
var collectionCipherRepository = sutProvider.GetDependency<ICollectionCipherRepository>();
|
||||
collectionCipherRepository.GetManyByUserIdCipherIdAsync(cipher.UserId.Value, cipher.Id).Returns(
|
||||
collectionCipherRepository.GetManyByUserIdCipherIdAsync(cipher.UserId.Value, cipher.Id, Arg.Any<bool>()).Returns(
|
||||
Task.FromResult((ICollection<CollectionCipher>)new List<CollectionCipher>
|
||||
{
|
||||
new CollectionCipher
|
||||
@ -512,7 +512,7 @@ public class CipherServiceTests
|
||||
Assert.Contains("ex from StartShareAttachmentAsync", exception.Message);
|
||||
|
||||
await collectionCipherRepository.Received().UpdateCollectionsAsync(cipher.Id, cipher.UserId.Value,
|
||||
Arg.Is<List<Guid>>(ids => ids.Count == 1 && ids[0] != collectionIds[0]));
|
||||
Arg.Is<List<Guid>>(ids => ids.Count == 1 && ids[0] != collectionIds[0]), Arg.Any<bool>());
|
||||
|
||||
await cipherRepository.Received().ReplaceAsync(Arg.Is<Cipher>(c =>
|
||||
c.GetAttachments()[v0AttachmentId].Key == null
|
||||
@ -537,7 +537,7 @@ public class CipherServiceTests
|
||||
var attachmentStorageService = sutProvider.GetDependency<IAttachmentStorageService>();
|
||||
var userRepository = sutProvider.GetDependency<IUserRepository>();
|
||||
var collectionCipherRepository = sutProvider.GetDependency<ICollectionCipherRepository>();
|
||||
collectionCipherRepository.GetManyByUserIdCipherIdAsync(cipher.UserId.Value, cipher.Id).Returns(
|
||||
collectionCipherRepository.GetManyByUserIdCipherIdAsync(cipher.UserId.Value, cipher.Id, Arg.Any<bool>()).Returns(
|
||||
Task.FromResult((ICollection<CollectionCipher>)new List<CollectionCipher>
|
||||
{
|
||||
new CollectionCipher
|
||||
@ -644,7 +644,7 @@ public class CipherServiceTests
|
||||
Assert.Contains("ex from StartShareAttachmentAsync", exception.Message);
|
||||
|
||||
await collectionCipherRepository.Received().UpdateCollectionsAsync(cipher.Id, cipher.UserId.Value,
|
||||
Arg.Is<List<Guid>>(ids => ids.Count == 1 && ids[0] != collectionIds[0]));
|
||||
Arg.Is<List<Guid>>(ids => ids.Count == 1 && ids[0] != collectionIds[0]), Arg.Any<bool>());
|
||||
|
||||
await cipherRepository.Received().ReplaceAsync(Arg.Is<Cipher>(c =>
|
||||
c.GetAttachments()[v0AttachmentId1].Key == null
|
||||
|
Reference in New Issue
Block a user