mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 12:08:36 +02:00
Record metrics for WHOIS commands
Note that this does not write out metrics for invocations of the nomulus tool. This requires a slight refactoring of the existing WhoisResponse interface so as to also support returning the number of results found by the WHOIS query. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149461208
This commit is contained in:
parent
4eef02f17f
commit
3fcb564251
15 changed files with 247 additions and 62 deletions
|
@ -37,6 +37,7 @@ import google.registry.model.host.HostResource;
|
|||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.whois.WhoisResponse.WhoisResponseResults;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
|
@ -239,16 +240,16 @@ public class DomainWhoisResponseTest {
|
|||
public void getPlainTextOutputTest() {
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(domainResource, clock.nowUtc());
|
||||
assertThat(domainWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
|
||||
.isEqualTo(loadWhoisTestFile("whois_domain.txt"));
|
||||
assertThat(domainWhoisResponse.getResponse(false, "Doodle Disclaimer"))
|
||||
.isEqualTo(WhoisResponseResults.create(loadWhoisTestFile("whois_domain.txt"), 1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addImplicitOkStatusTest() {
|
||||
DomainWhoisResponse domainWhoisResponse = new DomainWhoisResponse(
|
||||
domainResource.asBuilder().setStatusValues(null).build(),
|
||||
clock.nowUtc());
|
||||
assertThat(domainWhoisResponse.getPlainTextOutput(false, "Doodle Disclaimer"))
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(
|
||||
domainResource.asBuilder().setStatusValues(null).build(), clock.nowUtc());
|
||||
assertThat(domainWhoisResponse.getResponse(false, "Doodle Disclaimer").plainTextOutput())
|
||||
.contains("Domain Status: ok");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue