Skip to content

Commit 8b3a908

Browse files
ACME Account test cleanup
1 parent 18294cd commit 8b3a908

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Certify.Tests/Certify.Core.Tests.Unit/Tests/CertifyManagerAccountTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task TestInit()
5757

5858
await AddCustomCa();
5959
await AddNewCustomCaAccount();
60-
await CheckForExistingLeAccount();
60+
await CheckForExistingAcmeAccount();
6161
}
6262

6363
[TestCleanup]
@@ -146,7 +146,7 @@ private static async Task BootstrapStepCa()
146146
}
147147
}
148148

149-
// Run bootstrap command
149+
// Run bootstrap command: requires step-cli to be installed on the host machine and in the system path
150150
var args = $"ca bootstrap -f --ca-url https://{_caDomain}:{_caPort} --fingerprint {stepCaFingerprint}";
151151
RunCommand("step", args, "Bootstrap Step CA Script", 1000 * 30);
152152
}
@@ -377,17 +377,15 @@ private async Task AddNewCustomCaAccount()
377377
}
378378
}
379379

380-
private async Task CheckForExistingLeAccount()
380+
private async Task CheckForExistingAcmeAccount()
381381
{
382-
if ((await _certifyManager.GetAccountRegistrations()).Find(a => a.CertificateAuthorityId == "letsencrypt.org") == null)
382+
if ((await _certifyManager.GetAccountRegistrations()).Find(a => a.CertificateAuthorityId == _customCa.Id) == null)
383383
{
384384
var contactRegistration = new ContactRegistration
385385
{
386386
AgreedToTermsAndConditions = true,
387-
CertificateAuthorityId = "letsencrypt.org",
387+
CertificateAuthorityId = _customCa.Id,
388388
EmailAddress = "admin." + Guid.NewGuid().ToString().Substring(0, 6) + "@test.com",
389-
ImportedAccountKey = "",
390-
ImportedAccountURI = "",
391389
IsStaging = true
392390
};
393391

@@ -1107,11 +1105,13 @@ public async Task TestCertifyManagerUpdateCertificateAuthorityUpdate()
11071105
public async Task TestCertifyManagerUpdateCertificateAuthorityDefaultCa()
11081106
{
11091107
var certificateAuthorities = await _certifyManager.GetCertificateAuthorities();
1110-
var defaultCa = certificateAuthorities.First();
1108+
1109+
// find a built in CA we will try to update
1110+
var defaultCa = certificateAuthorities.First(ca => ca.IsCustom == false);
11111111
var newCustomCa = new CertificateAuthority
11121112
{
11131113
Id = defaultCa.Id,
1114-
Title = "Test Custom CA",
1114+
Title = "Test CA Update",
11151115
IsCustom = true,
11161116
IsEnabled = true,
11171117
AllowInternalHostnames = false,

0 commit comments

Comments
 (0)