mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
SM-1119: Rename service accounts to machine accounts (#3958)
* SM-1119: Rename service accounts to machine accounts * SM-1119: Undo system management portal changes
This commit is contained in:
@ -410,7 +410,7 @@ public class OrganizationServiceTests
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||
() => sutProvider.Sut.SignUpAsync(signup));
|
||||
Assert.Contains("Plan does not allow additional Service Accounts.", exception.Message);
|
||||
Assert.Contains("Plan does not allow additional Machine Accounts.", exception.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -444,7 +444,7 @@ public class OrganizationServiceTests
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||
() => sutProvider.Sut.SignUpAsync(signup));
|
||||
Assert.Contains("You can't subtract Service Accounts!", exception.Message);
|
||||
Assert.Contains("You can't subtract Machine Accounts!", exception.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -2208,7 +2208,7 @@ OrganizationUserInvite invite, SutProvider<OrganizationService> sutProvider)
|
||||
AdditionalSeats = 3
|
||||
};
|
||||
var exception = Assert.Throws<BadRequestException>(() => sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup));
|
||||
Assert.Contains("Plan does not allow additional Service Accounts.", exception.Message);
|
||||
Assert.Contains("Plan does not allow additional Machine Accounts.", exception.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -2249,7 +2249,7 @@ OrganizationUserInvite invite, SutProvider<OrganizationService> sutProvider)
|
||||
AdditionalSeats = 5
|
||||
};
|
||||
var exception = Assert.Throws<BadRequestException>(() => sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup));
|
||||
Assert.Contains("You can't subtract Service Accounts!", exception.Message);
|
||||
Assert.Contains("You can't subtract Machine Accounts!", exception.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
@ -447,7 +447,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
var update = new SecretsManagerSubscriptionUpdate(organization, false).AdjustServiceAccounts(1);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Organization has no service accounts limit, no need to adjust service accounts", exception.Message);
|
||||
Assert.Contains("Organization has no machine accounts limit, no need to adjust machine accounts", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
var update = new SecretsManagerSubscriptionUpdate(organization, true).AdjustServiceAccounts(-2);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Cannot use autoscaling to subtract service accounts.", exception.Message);
|
||||
Assert.Contains("Cannot use autoscaling to subtract machine accounts.", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -475,7 +475,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
var update = new SecretsManagerSubscriptionUpdate(organization, false).AdjustServiceAccounts(1);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("You have reached the maximum number of service accounts (3) for this plan",
|
||||
Assert.Contains("You have reached the maximum number of machine accounts (3) for this plan",
|
||||
exception.Message, StringComparison.InvariantCultureIgnoreCase);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
@ -492,7 +492,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
var update = new SecretsManagerSubscriptionUpdate(organization, true).AdjustServiceAccounts(2);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Secrets Manager service account limit has been reached.", exception.Message);
|
||||
Assert.Contains("Secrets Manager machine account limit has been reached.", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -516,7 +516,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||
() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Cannot set max service accounts autoscaling below service account amount", exception.Message);
|
||||
Assert.Contains("Cannot set max machine accounts autoscaling below machine account amount", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||
() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Plan has a minimum of 200 service accounts", exception.Message);
|
||||
Assert.Contains("Plan has a minimum of 200 machine accounts", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -570,7 +570,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
.Returns(currentServiceAccounts);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Your organization currently has 301 service accounts. You cannot decrease your subscription below your current service account usage", exception.Message);
|
||||
Assert.Contains("Your organization currently has 301 machine accounts. You cannot decrease your subscription below your current machine account usage", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
@ -648,7 +648,7 @@ public class UpdateSecretsManagerSubscriptionCommandTests
|
||||
var update = new SecretsManagerSubscriptionUpdate(organization, false) { MaxAutoscaleSmServiceAccounts = 3 };
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSubscriptionAsync(update));
|
||||
Assert.Contains("Your plan does not allow service accounts autoscaling.", exception.Message);
|
||||
Assert.Contains("Your plan does not allow machine accounts autoscaling.", exception.Message);
|
||||
await VerifyDependencyNotCalledAsync(sutProvider);
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ public class UpgradeOrganizationPlanCommandTests
|
||||
.GetServiceAccountCountByOrganizationIdAsync(organization.Id).Returns(currentServiceAccounts);
|
||||
|
||||
var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpgradePlanAsync(organization.Id, upgrade));
|
||||
Assert.Contains($"Your organization currently has {currentServiceAccounts} service accounts. Your new plan only allows", exception.Message);
|
||||
Assert.Contains($"Your organization currently has {currentServiceAccounts} machine accounts. Your new plan only allows", exception.Message);
|
||||
|
||||
sutProvider.GetDependency<IOrganizationService>().DidNotReceiveWithAnyArgs().ReplaceAndUpdateCacheAsync(default);
|
||||
}
|
||||
|
Reference in New Issue
Block a user