mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[SM-394] Secrets Manager (#2164)
Long lived feature branch for Secrets Manager Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com> Co-authored-by: CarleyDiaz-Bitwarden <103955722+CarleyDiaz-Bitwarden@users.noreply.github.com> Co-authored-by: Thomas Avery <tavery@bitwarden.com> Co-authored-by: Colton Hurst <colton@coltonhurst.com>
This commit is contained in:
33
test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs
Normal file
33
test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Business;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
using Bit.IntegrationTestCommon.Factories;
|
||||
|
||||
namespace Bit.Api.IntegrationTest.Helpers;
|
||||
|
||||
public static class OrganizationTestHelpers
|
||||
{
|
||||
public static async Task<Tuple<Organization, OrganizationUser>> SignUpAsync<T>(WebApplicationFactoryBase<T> factory,
|
||||
PlanType plan = PlanType.Free,
|
||||
string ownerEmail = "integration-test@bitwarden.com",
|
||||
string name = "Integration Test Org",
|
||||
string billingEmail = "integration-test@bitwarden.com",
|
||||
string ownerKey = "test-key") where T : class
|
||||
{
|
||||
var userRepository = factory.GetService<IUserRepository>();
|
||||
var organizationService = factory.GetService<IOrganizationService>();
|
||||
|
||||
var owner = await userRepository.GetByEmailAsync(ownerEmail);
|
||||
|
||||
return await organizationService.SignUpAsync(new OrganizationSignup
|
||||
{
|
||||
Name = name,
|
||||
BillingEmail = billingEmail,
|
||||
Plan = plan,
|
||||
OwnerKey = ownerKey,
|
||||
Owner = owner,
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user