mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
SM-1012: Removing SM Beta (Phase 2) (#3663)
* SM-1012: Phase 2, removing SM Beta from the server (but not db) * SM-1012: Add migration for RemoveSMBetaFromOrganization * SM-1012: Dotnet format * SM-1012: Undo RemoveSMBetaFromOrganization EF migration * SM-1012: Redo RemoveSMBetaFromOrganization EF migration * SM-1012: Ran dotnet format
This commit is contained in:
@ -26,7 +26,7 @@ public class CountNewServiceAccountSlotsRequiredQuery : ICountNewServiceAccountS
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
if (!organization.SmServiceAccounts.HasValue || serviceAccountsToAdd == 0 || organization.SecretsManagerBeta)
|
||||
if (!organization.SmServiceAccounts.HasValue || serviceAccountsToAdd == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
||||
{
|
||||
organization.UseSecretsManager = true;
|
||||
organization.SmServiceAccounts = organizationSmServiceAccounts;
|
||||
organization.SecretsManagerBeta = false;
|
||||
|
||||
sutProvider.GetDependency<IOrganizationRepository>()
|
||||
.GetByIdAsync(organization.Id)
|
||||
@ -62,7 +61,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
||||
|
||||
organization.UseSecretsManager = true;
|
||||
organization.SmServiceAccounts = null;
|
||||
organization.SecretsManagerBeta = false;
|
||||
|
||||
sutProvider.GetDependency<IOrganizationRepository>()
|
||||
.GetByIdAsync(organization.Id)
|
||||
@ -80,27 +78,6 @@ public class CountNewServiceAccountSlotsRequiredQueryTests
|
||||
.GetServiceAccountCountByOrganizationIdAsync(default);
|
||||
}
|
||||
|
||||
[Theory, BitAutoData]
|
||||
public async Task CountNewServiceAccountSlotsRequiredAsync_WithSecretsManagerBeta_ReturnsZero(
|
||||
int serviceAccountsToAdd,
|
||||
Organization organization,
|
||||
SutProvider<CountNewServiceAccountSlotsRequiredQuery> sutProvider)
|
||||
{
|
||||
organization.UseSecretsManager = true;
|
||||
organization.SecretsManagerBeta = true;
|
||||
|
||||
sutProvider.GetDependency<IOrganizationRepository>()
|
||||
.GetByIdAsync(organization.Id)
|
||||
.Returns(organization);
|
||||
|
||||
var result = await sutProvider.Sut.CountNewServiceAccountSlotsRequiredAsync(organization.Id, serviceAccountsToAdd);
|
||||
|
||||
Assert.Equal(0, result);
|
||||
|
||||
await sutProvider.GetDependency<IServiceAccountRepository>().DidNotReceiveWithAnyArgs()
|
||||
.GetServiceAccountCountByOrganizationIdAsync(default);
|
||||
}
|
||||
|
||||
[Theory, BitAutoData]
|
||||
public async Task CountNewServiceAccountSlotsRequiredAsync_WithNonExistentOrganizationId_ThrowsNotFound(
|
||||
Guid organizationId, int serviceAccountsToAdd,
|
||||
|
Reference in New Issue
Block a user