mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 18:55:58 +02:00
Add RDAP pretty-printing option
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=176529676
This commit is contained in:
parent
6f659659ff
commit
67a41273bb
13 changed files with 71 additions and 9 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue