diff --git a/javatests/google/registry/rdap/RdapTestHelper.java b/javatests/google/registry/rdap/RdapTestHelper.java index c5afc0fa9..473343044 100644 --- a/javatests/google/registry/rdap/RdapTestHelper.java +++ b/javatests/google/registry/rdap/RdapTestHelper.java @@ -50,9 +50,7 @@ public class RdapTestHelper { } static ImmutableList> createNotices( - String linkBase, - ContactNoticeType contactNoticeType, - @Nullable Object otherNotices) { + String linkBase, ContactNoticeType contactNoticeType, @Nullable Object otherNotices) { ImmutableList.Builder> noticesBuilder = getBuilderWithOthersAdded(otherNotices); switch (contactNoticeType) { @@ -67,12 +65,14 @@ public class RdapTestHelper { case CONTACT: noticesBuilder.add( ImmutableMap.of( - "title", "Data Policy", + "title", + "Data Policy", "description", ImmutableList.of( "Some of the data in this object has been removed.", "Contact personal data is visible only to the owning registrar."), - "type", "object truncated due to authorization", + "type", + "object truncated due to authorization", "links", ImmutableList.of( ImmutableMap.of( @@ -215,53 +215,56 @@ public class RdapTestHelper { static RdapJsonFormatter getTestRdapJsonFormatter() { RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter(); rdapJsonFormatter.rdapTosPath = "/tos"; - rdapJsonFormatter.rdapHelpMap = ImmutableMap.of( - "/", - RdapNoticeDescriptor.builder() - .setTitle("RDAP Help") - .setDescription(ImmutableList.of( - "domain/XXXX", - "nameserver/XXXX", - "entity/XXXX", - "domains?name=XXXX", - "domains?nsLdhName=XXXX", - "domains?nsIp=XXXX", - "nameservers?name=XXXX", - "nameservers?ip=XXXX", - "entities?fn=XXXX", - "entities?handle=XXXX", - "help/XXXX")) - .setLinkValueSuffix("help/") - .setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md") - .build(), - "/tos", - RdapNoticeDescriptor.builder() - .setTitle("RDAP Terms of Service") - .setDescription(ImmutableList.of( - "By querying our Domain Database, you are agreeing to comply with these terms so" - + " please read them carefully.", - "Any information provided is 'as is' without any guarantee of accuracy.", - "Please do not misuse the Domain Database. It is intended solely for" - + " query-based access.", - "Don't use the Domain Database to allow, enable, or otherwise support the" - + " transmission of mass unsolicited, commercial advertising or" - + " solicitations.", - "Don't access our Domain Database through the use of high volume, automated" - + " electronic processes that send queries or data to the systems of any" - + " ICANN-accredited registrar.", - "You may only use the information contained in the Domain Database for lawful" - + " purposes.", - "Do not compile, repackage, disseminate, or otherwise use the information" - + " contained in the Domain Database in its entirety, or in any substantial" - + " portion, without our prior written permission.", - "We may retain certain details about queries to our Domain Database for the" - + " purposes of detecting and preventing misuse.", - "We reserve the right to restrict or deny your access to the database if we" - + " suspect that you have failed to comply with these terms.", - "We reserve the right to modify this agreement at any time.")) - .setLinkValueSuffix("help/tos") - .setLinkHrefUrlString("https://www.registry.tld/about/rdap/tos.html") - .build()); + rdapJsonFormatter.rdapHelpMap = + ImmutableMap.of( + "/", + RdapNoticeDescriptor.builder() + .setTitle("RDAP Help") + .setDescription( + ImmutableList.of( + "domain/XXXX", + "nameserver/XXXX", + "entity/XXXX", + "domains?name=XXXX", + "domains?nsLdhName=XXXX", + "domains?nsIp=XXXX", + "nameservers?name=XXXX", + "nameservers?ip=XXXX", + "entities?fn=XXXX", + "entities?handle=XXXX", + "help/XXXX")) + .setLinkValueSuffix("help/") + .setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md") + .build(), + "/tos", + RdapNoticeDescriptor.builder() + .setTitle("RDAP Terms of Service") + .setDescription( + ImmutableList.of( + "By querying our Domain Database, you are agreeing to comply with these" + + " terms so please read them carefully.", + "Any information provided is 'as is' without any guarantee of accuracy.", + "Please do not misuse the Domain Database. It is intended solely for" + + " query-based access.", + "Don't use the Domain Database to allow, enable, or otherwise support the" + + " transmission of mass unsolicited, commercial advertising or" + + " solicitations.", + "Don't access our Domain Database through the use of high volume, automated" + + " electronic processes that send queries or data to the systems of" + + " any ICANN-accredited registrar.", + "You may only use the information contained in the Domain Database for" + + " lawful purposes.", + "Do not compile, repackage, disseminate, or otherwise use the information" + + " contained in the Domain Database in its entirety, or in any" + + " substantial portion, without our prior written permission.", + "We may retain certain details about queries to our Domain Database for the" + + " purposes of detecting and preventing misuse.", + "We reserve the right to restrict or deny your access to the database if we" + + " suspect that you have failed to comply with these terms.", + "We reserve the right to modify this agreement at any time.")) + .setLinkValueSuffix("help/tos") + .setLinkHrefUrlString("https://www.registry.tld/about/rdap/tos.html") + .build()); return rdapJsonFormatter; } diff --git a/javatests/google/registry/util/HexDumperTest.java b/javatests/google/registry/util/HexDumperTest.java index 99a81896b..82f9047fc 100644 --- a/javatests/google/registry/util/HexDumperTest.java +++ b/javatests/google/registry/util/HexDumperTest.java @@ -122,10 +122,11 @@ public class HexDumperTest { assertThat(out.toString()).isEmpty(); // But one more byte will bring the total to N+1, thereby flushing a line of hexdump output. dumper.write(0); - assertThat(out.toString()).isEqualTo("" - + "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f 75 6e 64 " - + "20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 20 62 75 79 2e " - + "00 Sweet to tongue and sound to eye; Come buy, come buy..\n"); + assertThat(out.toString()) + .isEqualTo( + "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f " + + "75 6e 64 20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 " + + "20 62 75 79 2e 00 Sweet to tongue and sound to eye; Come buy, come buy..\n"); // No additional data will need to be written upon close. int oldTotal = out.toString().length(); assertThat(out.toString().length()).isEqualTo(oldTotal); diff --git a/javatests/google/registry/util/PosixTarHeaderTest.java b/javatests/google/registry/util/PosixTarHeaderTest.java index dd87ddb8c..e9296b85b 100644 --- a/javatests/google/registry/util/PosixTarHeaderTest.java +++ b/javatests/google/registry/util/PosixTarHeaderTest.java @@ -44,42 +44,46 @@ public class PosixTarHeaderTest { // head -c 1024 inrain // chmod 0600 liketears inrain // tar --format=ustar -c liketears inrain | gzip | base64 - InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" - + "H4sIAIl5DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" - + "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" - + "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" - + "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); + InputStream input = + new GZIPInputStream( + new ByteArrayInputStream( + base64() + .decode( + "H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h" + + "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh" + + "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL" + + "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); PosixTarHeader header; byte[] block = new byte[512]; @@ -299,11 +308,15 @@ public class PosixTarHeaderTest { // echo no wind can soothe my pain >inrain // chmod 0600 liketears inrain // tar -c liketears inrain | gzip | base64 - InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" - + "H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" - + "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" - + "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" - + "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); + InputStream input = + new GZIPInputStream( + new ByteArrayInputStream( + base64() + .decode( + "H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h" + + "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh" + + "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL" + + "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); PosixTarHeader header; byte[] block = new byte[512]; @@ -353,11 +366,15 @@ public class PosixTarHeaderTest { // echo no wind can soothe my pain >inrain // chmod 0600 liketears inrain // tar -c liketears inrain | gzip | base64 - InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" - + "H4sIAHV8DVIAA+3TTQ6CMBCG4a49xRxhWqCcp1Ei+FMMYIi3t3RhXOkKjMn77Npp0klmvkt3bqY" - + "mDKNZjyZe1WhVWud9Olvrreb7rKiNdU4LV3tblSaVnVcjumJPL/dxCoOIOYVh+vSuicct2tla7G" - + "UIXZR9iDKHsZUwh4dcH5KXYvfr9rCyLi7jX/eP7/kv3vKf6larqiD/W0j5n7t4yPkf+35qmyX8t" - + "7QTZB8AAAAAAAAAAAAAAOAfPAE43i9LACgAAA=="))); + InputStream input = + new GZIPInputStream( + new ByteArrayInputStream( + base64() + .decode( + "H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V" + + "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V" + + "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5" + + "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA="))); PosixTarHeader header; byte[] block = new byte[512]; @@ -407,11 +424,15 @@ public class PosixTarHeaderTest { // echo no wind can soothe my pain >inrain // chmod 0600 liketears inrain // tar --format=ustar -c liketears inrain | gzip | base64 - InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" - + "H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4Vn3" - + "l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2VfG8es77Kc" - + "u4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5P8XUv6HEE9z/rum6" - + "etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA="))); + InputStream input = + new GZIPInputStream( + new ByteArrayInputStream( + base64() + .decode( + "H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V" + + "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V" + + "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5" + + "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA="))); PosixTarHeader header; byte[] block = new byte[512];