mirror of
https://github.com/google/nomulus
synced 2026-09-27 10:24:15 +00:00
Add RDAP pretty-printing option
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=176529676
This commit is contained in:
@@ -123,6 +123,7 @@ public class RdapActionBaseTest {
|
||||
action.authResult = AuthResult.create(AuthLevel.USER, userAuthInfo);
|
||||
action.includeDeletedParam = Optional.empty();
|
||||
action.registrarParam = Optional.empty();
|
||||
action.formatOutputParam = Optional.empty();
|
||||
action.response = response;
|
||||
action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter();
|
||||
action.rdapMetrics = rdapMetrics;
|
||||
@@ -231,4 +232,25 @@ public class RdapActionBaseTest {
|
||||
.setIncompletenessWarningType(IncompletenessWarningType.COMPLETE)
|
||||
.build());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnformatted() throws Exception {
|
||||
action.requestPath = RdapTestAction.PATH + "no.thing";
|
||||
action.fullServletPath = "http://myserver.example.com" + RdapTestAction.PATH;
|
||||
action.requestMethod = GET;
|
||||
action.run();
|
||||
assertThat(response.getPayload() + '\n').isEqualTo(
|
||||
loadFileWithSubstitutions(this.getClass(), "rdap_unformatted_output.json", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatted() throws Exception {
|
||||
action.requestPath = RdapTestAction.PATH + "no.thing?formatOutput=true";
|
||||
action.fullServletPath = "http://myserver.example.com" + RdapTestAction.PATH;
|
||||
action.requestMethod = GET;
|
||||
action.formatOutputParam = Optional.of(true);
|
||||
action.run();
|
||||
assertThat(response.getPayload() + '\n').isEqualTo(
|
||||
loadFileWithSubstitutions(this.getClass(), "rdap_formatted_output.json", null));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user