Expand nomulus get_domain command to load up deleted domain data too (#2018)

This commit is contained in:
Pavlo Tkach
2023-05-10 16:05:03 -04:00
committed by GitHub
parent 1aef31efff
commit 2667a0e977
2 changed files with 45 additions and 4 deletions
@@ -116,4 +116,25 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
assertInStdout("domainName=example.tld");
assertInStdout("Domain 'example.com' does not exist or is deleted");
}
@Test
void testSuccess_printDeletedDomain() throws Exception {
persistDeletedDomain("example.tld", fakeClock.nowUtc().minusDays(1));
runCommand("--show_deleted", "example.tld");
assertInStdout("domainName=example.tld");
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE");
}
@Test
void testSuccess_printsEntireDomainHistory() throws Exception {
persistActiveDomain("example.tld");
persistDeletedDomain("example.tld", fakeClock.nowUtc().minusDays(1));
runCommand("--show_deleted", "example.tld");
assertInStdout("domainName=example.tld");
// Active
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE");
// Deleted
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTQtVExE");
}
}