From b8970bfe1b924603e74ae7814be982e61108f8ed Mon Sep 17 00:00:00 2001 From: guyben Date: Fri, 1 Dec 2017 10:16:22 -0800 Subject: [PATCH] Rename all testdata loading files to conform to a single naming scheme The scheme is: - loadBytes: returns a ByteSource of the data - loadFile: returns a string using UTF8 encoding, optionally applying substitutions ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177606406 --- .../registry/flows/EppControllerTest.java | 7 +-- .../google/registry/flows/EppTestCase.java | 7 +-- .../registry/flows/FlowReporterTest.java | 6 +- .../google/registry/flows/FlowRunnerTest.java | 6 +- .../google/registry/flows/FlowTestCase.java | 9 ++- .../flows/contact/ContactCheckFlowTest.java | 2 +- .../flows/contact/ContactCreateFlowTest.java | 4 +- .../flows/contact/ContactDeleteFlowTest.java | 6 +- .../flows/contact/ContactInfoFlowTest.java | 10 ++-- .../ContactTransferApproveFlowTest.java | 4 +- .../ContactTransferCancelFlowTest.java | 4 +- .../contact/ContactTransferQueryFlowTest.java | 2 +- .../ContactTransferRejectFlowTest.java | 4 +- .../ContactTransferRequestFlowTest.java | 4 +- .../flows/contact/ContactUpdateFlowTest.java | 18 +++--- .../flows/domain/DomainAllocateFlowTest.java | 2 +- .../DomainApplicationCreateFlowTest.java | 14 ++--- .../DomainApplicationDeleteFlowTest.java | 16 ++--- .../domain/DomainApplicationInfoFlowTest.java | 4 +- .../DomainApplicationUpdateFlowTest.java | 16 ++--- .../flows/domain/DomainCheckFlowTest.java | 58 +++++++++---------- .../domain/DomainClaimsCheckFlowTest.java | 4 +- .../flows/domain/DomainCreateFlowTest.java | 56 +++++++++--------- .../flows/domain/DomainDeleteFlowTest.java | 44 +++++++------- .../flows/domain/DomainInfoFlowTest.java | 4 +- .../flows/domain/DomainRenewFlowTest.java | 10 ++-- .../domain/DomainRestoreRequestFlowTest.java | 24 ++++---- .../domain/DomainTransferApproveFlowTest.java | 6 +- .../domain/DomainTransferCancelFlowTest.java | 6 +- .../domain/DomainTransferQueryFlowTest.java | 2 +- .../domain/DomainTransferRejectFlowTest.java | 6 +- .../domain/DomainTransferRequestFlowTest.java | 6 +- .../flows/domain/DomainUpdateFlowTest.java | 32 +++++----- .../flows/host/HostCheckFlowTest.java | 2 +- .../flows/host/HostCreateFlowTest.java | 4 +- .../flows/host/HostDeleteFlowTest.java | 10 ++-- .../registry/flows/host/HostInfoFlowTest.java | 6 +- .../flows/host/HostUpdateFlowTest.java | 22 +++---- .../registry/flows/poll/PollAckFlowTest.java | 14 ++--- .../flows/poll/PollRequestFlowTest.java | 20 +++---- .../registry/flows/session/HelloFlowTest.java | 7 +-- .../flows/session/LoginFlowTestCase.java | 2 +- .../flows/session/LogoutFlowTest.java | 2 +- .../registry/rdap/RdapActionBaseTest.java | 6 +- .../registry/rdap/RdapDomainActionTest.java | 5 +- .../rdap/RdapDomainSearchActionTest.java | 11 ++-- .../registry/rdap/RdapEntityActionTest.java | 4 +- .../rdap/RdapEntitySearchActionTest.java | 11 ++-- .../registry/rdap/RdapHelpActionTest.java | 6 +- .../registry/rdap/RdapJsonFormatterTest.java | 4 +- .../rdap/RdapNameserverActionTest.java | 4 +- .../rdap/RdapNameserverSearchActionTest.java | 4 +- .../registry/rde/BrdaCopyActionTest.java | 6 +- .../rde/GhostrydeGpgIntegrationTest.java | 4 +- .../registry/rde/RdeReportActionTest.java | 6 +- .../google/registry/rde/RdeTestData.java | 4 +- .../registry/rde/RdeUploadActionTest.java | 8 +-- .../registry/rde/RydeGpgIntegrationTest.java | 4 +- .../imports/RdeContactImportActionTest.java | 2 +- .../rde/imports/RdeContactInputTest.java | 12 ++-- .../rde/imports/RdeContactReaderTest.java | 8 +-- .../imports/RdeDomainImportActionTest.java | 7 ++- .../rde/imports/RdeDomainReaderTest.java | 10 ++-- .../rde/imports/RdeHostImportActionTest.java | 3 +- .../rde/imports/RdeHostInputTest.java | 24 ++++---- .../rde/imports/RdeHostLinkActionTest.java | 3 +- .../rde/imports/RdeHostReaderTest.java | 9 +-- .../rde/imports/RdeImportUtilsTest.java | 8 +-- .../rde/imports/RdeImportsTestData.java | 4 +- .../registry/rde/imports/RdeParserTest.java | 3 +- .../XjcToContactResourceConverterTest.java | 3 +- .../XjcToDomainResourceConverterTest.java | 2 +- .../XjcToHostResourceConverterTest.java | 4 +- .../ActivityReportingQueryBuilderTest.java | 2 +- .../reporting/IcannHttpReporterTest.java | 4 +- .../registry/reporting/ReportingTestData.java | 4 +- ...TransactionsReportingQueryBuilderTest.java | 2 +- .../google/registry/testing/EppLoader.java | 4 +- .../registry/testing/TestDataHelper.java | 2 +- .../tmch/TmchCertificateAuthorityTest.java | 6 +- .../google/registry/tmch/TmchTestData.java | 4 +- .../tools/AllocateDomainCommandTest.java | 4 +- .../registry/tools/EppToolCommandTest.java | 8 +-- .../registry/tools/EppToolVerifier.java | 10 ++-- .../registry/tools/ExecuteEppCommandTest.java | 4 +- .../ValidateEscrowDepositCommandTest.java | 6 +- .../registry/tools/server/ToolsTestData.java | 8 +-- .../tools/server/VerifyOteActionTest.java | 42 +++++++------- .../whois/DomainWhoisResponseTest.java | 4 +- .../whois/NameserverWhoisResponseTest.java | 6 +- .../whois/RegistrarWhoisResponseTest.java | 4 +- .../registry/whois/WhoisHttpServerTest.java | 26 ++++----- .../registry/whois/WhoisServerTest.java | 40 ++++++------- .../{WhoisHelper.java => WhoisTestData.java} | 6 +- 94 files changed, 428 insertions(+), 449 deletions(-) rename javatests/google/registry/whois/{WhoisHelper.java => WhoisTestData.java} (83%) diff --git a/javatests/google/registry/flows/EppControllerTest.java b/javatests/google/registry/flows/EppControllerTest.java index eb4a770ea..9b1f70d9c 100644 --- a/javatests/google/registry/flows/EppControllerTest.java +++ b/javatests/google/registry/flows/EppControllerTest.java @@ -20,7 +20,7 @@ import static com.google.common.truth.Truth8.assertThat; import static google.registry.flows.EppXmlTransformer.marshal; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.LogsSubject.assertAboutLogs; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static google.registry.testing.TestLogHandlerUtils.findFirstLogRecordWithMessagePrefix; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.logging.Level.INFO; @@ -31,7 +31,6 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import com.google.common.base.Splitter; -import com.google.common.collect.ImmutableMap; import com.google.common.testing.TestLogHandler; import google.registry.flows.EppException.UnimplementedExtensionException; import google.registry.flows.EppTestComponent.FakeServerTridProvider; @@ -93,9 +92,7 @@ public class EppControllerTest extends ShardableTestCase { */ private final Logger loggerToIntercept = Logger.getLogger(EppController.class.getCanonicalName()); - private final String domainCreateXml = - loadFileWithSubstitutions( - getClass(), "domain_create_prettyprinted.xml", ImmutableMap.of()); + private final String domainCreateXml = loadFile(getClass(), "domain_create_prettyprinted.xml"); private EppController eppController; diff --git a/javatests/google/registry/flows/EppTestCase.java b/javatests/google/registry/flows/EppTestCase.java index 6610807d9..ecd9bdb99 100644 --- a/javatests/google/registry/flows/EppTestCase.java +++ b/javatests/google/registry/flows/EppTestCase.java @@ -16,7 +16,7 @@ package google.registry.flows; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ofy.ObjectifyService.ofy; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static google.registry.xml.XmlTestUtils.assertXmlEqualsWithMessage; import static java.nio.charset.StandardCharsets.UTF_8; import static javax.servlet.http.HttpServletResponse.SC_OK; @@ -88,9 +88,8 @@ public class EppTestCase extends ShardableTestCase { Map outputSubstitutions, DateTime now) throws Exception { clock.setTo(now); - String input = loadFileWithSubstitutions(getClass(), inputFilename, inputSubstitutions); - String expectedOutput = - loadFileWithSubstitutions(getClass(), outputFilename, outputSubstitutions); + String input = loadFile(getClass(), inputFilename, inputSubstitutions); + String expectedOutput = loadFile(getClass(), outputFilename, outputSubstitutions); if (sessionMetadata == null) { sessionMetadata = new HttpSessionMetadata(new FakeHttpSession()) { @Override diff --git a/javatests/google/registry/flows/FlowReporterTest.java b/javatests/google/registry/flows/FlowReporterTest.java index fc86dc3cf..8ba46f4bc 100644 --- a/javatests/google/registry/flows/FlowReporterTest.java +++ b/javatests/google/registry/flows/FlowReporterTest.java @@ -16,14 +16,13 @@ package google.registry.flows; import static com.google.common.io.BaseEncoding.base64; import static com.google.common.truth.Truth.assertThat; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static google.registry.testing.TestLogHandlerUtils.findFirstLogMessageByPrefix; import static java.nio.charset.StandardCharsets.UTF_8; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.common.testing.TestLogHandler; import google.registry.flows.annotations.ReportingSpec; import google.registry.model.eppcommon.Trid; @@ -88,8 +87,7 @@ public class FlowReporterTest extends ShardableTestCase { @Test public void testRecordToLogs_eppInput_complex() throws Exception { - String domainCreateXml = loadFileWithSubstitutions( - getClass(), "domain_create_prettyprinted.xml", ImmutableMap.of()); + String domainCreateXml = loadFile(getClass(), "domain_create_prettyprinted.xml"); flowReporter.inputXmlBytes = domainCreateXml.getBytes(UTF_8); flowReporter.recordToLogs(); assertThat(parseJsonMap(findFirstLogMessageByPrefix(handler, "FLOW-LOG-SIGNATURE-EPPINPUT: "))) diff --git a/javatests/google/registry/flows/FlowRunnerTest.java b/javatests/google/registry/flows/FlowRunnerTest.java index 3fa992ccd..bd20d72ca 100644 --- a/javatests/google/registry/flows/FlowRunnerTest.java +++ b/javatests/google/registry/flows/FlowRunnerTest.java @@ -16,7 +16,7 @@ package google.registry.flows; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth8.assertThat; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static google.registry.testing.TestLogHandlerUtils.findFirstLogMessageByPrefix; import static java.nio.charset.StandardCharsets.UTF_8; import static org.mockito.Mockito.mock; @@ -26,7 +26,6 @@ import static org.mockito.Mockito.verify; import com.google.appengine.api.users.User; import com.google.common.base.Joiner; import com.google.common.base.Splitter; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.testing.TestLogHandler; import google.registry.model.eppcommon.Trid; @@ -180,8 +179,7 @@ public class FlowRunnerTest extends ShardableTestCase { @Test public void testRun_legacyLoggingStatement_complexEppInput() throws Exception { - String domainCreateXml = loadFileWithSubstitutions( - getClass(), "domain_create_prettyprinted.xml", ImmutableMap.of()); + String domainCreateXml = loadFile(getClass(), "domain_create_prettyprinted.xml"); flowRunner.inputXmlBytes = domainCreateXml.getBytes(UTF_8); flowRunner.run(eppMetricBuilder); String logMessage = findFirstLogMessageByPrefix(handler, "EPP Command\n\t"); diff --git a/javatests/google/registry/flows/FlowTestCase.java b/javatests/google/registry/flows/FlowTestCase.java index c419d945f..5e7be49c3 100644 --- a/javatests/google/registry/flows/FlowTestCase.java +++ b/javatests/google/registry/flows/FlowTestCase.java @@ -22,7 +22,6 @@ import static google.registry.flows.EppXmlTransformer.marshal; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.BILLING_EVENT_ID_STRIPPER; import static google.registry.testing.DatastoreHelper.getPollMessages; -import static google.registry.testing.TestDataHelper.loadFile; import static google.registry.xml.XmlTestUtils.assertXmlEquals; import static java.nio.charset.StandardCharsets.UTF_8; import static org.joda.time.DateTimeZone.UTC; @@ -135,12 +134,12 @@ public abstract class FlowTestCase extends ShardableTestCase { return eppMetricBuilder.build(); } - protected String readFile(String filename) { - return loadFile(getClass(), filename); + protected String loadFile(String filename) { + return TestDataHelper.loadFile(getClass(), filename); } - protected String readFile(String filename, Map substitutions) { - return TestDataHelper.loadFileWithSubstitutions(getClass(), filename, substitutions); + protected String loadFile(String filename, Map substitutions) { + return TestDataHelper.loadFile(getClass(), filename, substitutions); } protected String getClientTrid() throws Exception { diff --git a/javatests/google/registry/flows/contact/ContactCheckFlowTest.java b/javatests/google/registry/flows/contact/ContactCheckFlowTest.java index 7dd3bf0f6..a7e342889 100644 --- a/javatests/google/registry/flows/contact/ContactCheckFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactCheckFlowTest.java @@ -63,7 +63,7 @@ public class ContactCheckFlowTest @Test public void testXmlMatches() throws Exception { persistActiveContact("sah8013"); - runFlowAssertResponse(readFile("contact_check_response.xml")); + runFlowAssertResponse(loadFile("contact_check_response.xml")); } @Test diff --git a/javatests/google/registry/flows/contact/ContactCreateFlowTest.java b/javatests/google/registry/flows/contact/ContactCreateFlowTest.java index 432c0b990..cc32d40d7 100644 --- a/javatests/google/registry/flows/contact/ContactCreateFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactCreateFlowTest.java @@ -38,7 +38,7 @@ public class ContactCreateFlowTest private void doSuccessfulTest() throws Exception { assertTransactionalFlow(true); - runFlowAssertResponse(readFile("contact_create_response.xml")); + runFlowAssertResponse(loadFile("contact_create_response.xml")); // Check that the contact was created and persisted with a history entry. assertAboutContacts().that(reloadResourceByForeignKey()) .hasOnlyOneHistoryEntryWhich().hasNoXml(); @@ -48,7 +48,7 @@ public class ContactCreateFlowTest @Test public void testDryRun() throws Exception { - dryRunFlowAssertResponse(readFile("contact_create_response.xml")); + dryRunFlowAssertResponse(loadFile("contact_create_response.xml")); } @Test diff --git a/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java b/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java index 57722346e..c87fa9efb 100644 --- a/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java @@ -48,7 +48,7 @@ public class ContactDeleteFlowTest @Test public void testDryRun() throws Exception { persistActiveContact(getUniqueIdFromCommand()); - dryRunFlowAssertResponse(readFile("contact_delete_response.xml")); + dryRunFlowAssertResponse(loadFile("contact_delete_response.xml")); } @Test @@ -56,7 +56,7 @@ public class ContactDeleteFlowTest persistActiveContact(getUniqueIdFromCommand()); clock.advanceOneMilli(); assertTransactionalFlow(true); - runFlowAssertResponse(readFile("contact_delete_response.xml")); + runFlowAssertResponse(loadFile("contact_delete_response.xml")); ContactResource deletedContact = reloadResourceByForeignKey(); assertAboutContacts().that(deletedContact).hasStatusValue(StatusValue.PENDING_DELETE); assertAsyncDeletionTaskEnqueued( @@ -126,7 +126,7 @@ public class ContactDeleteFlowTest persistActiveContact(getUniqueIdFromCommand()); clock.advanceOneMilli(); runFlowAssertResponse( - CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("contact_delete_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("contact_delete_response.xml")); ContactResource deletedContact = reloadResourceByForeignKey(); assertAboutContacts().that(deletedContact).hasStatusValue(StatusValue.PENDING_DELETE); assertAsyncDeletionTaskEnqueued( diff --git a/javatests/google/registry/flows/contact/ContactInfoFlowTest.java b/javatests/google/registry/flows/contact/ContactInfoFlowTest.java index 0108c6b33..46aa04d7e 100644 --- a/javatests/google/registry/flows/contact/ContactInfoFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactInfoFlowTest.java @@ -97,7 +97,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase expectedException) @@ -433,7 +433,7 @@ public class DomainCheckFlowTest public void testFeeExtension_v06() throws Exception { persistActiveDomain("example1.tld"); setEppInput("domain_check_fee_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_response_v06.xml")); } @Test @@ -446,21 +446,21 @@ public class DomainCheckFlowTest .build()); persistActiveDomain("example1.tld"); setEppInput("domain_check_fee_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_response_v06.xml")); } @Test public void testFeeExtension_v11() throws Exception { persistActiveDomain("example1.tld"); setEppInput("domain_check_fee_v11.xml"); - runFlowAssertResponse(readFile("domain_check_fee_response_v11.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_response_v11.xml")); } @Test public void testFeeExtension_v12() throws Exception { persistActiveDomain("example1.tld"); setEppInput("domain_check_fee_v12.xml"); - runFlowAssertResponse(readFile("domain_check_fee_response_v12.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_response_v12.xml")); } /** @@ -469,7 +469,7 @@ public class DomainCheckFlowTest @Test public void testFeeExtension_multipleCommands_v06() throws Exception { setEppInput("domain_check_fee_multiple_commands_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_multiple_commands_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_multiple_commands_response_v06.xml")); } // Version 11 cannot have multiple commands. @@ -477,7 +477,7 @@ public class DomainCheckFlowTest @Test public void testFeeExtension_multipleCommands_v12() throws Exception { setEppInput("domain_check_fee_multiple_commands_v12.xml"); - runFlowAssertResponse(readFile("domain_check_fee_multiple_commands_response_v12.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_multiple_commands_response_v12.xml")); } /** Test the same as {@link #testFeeExtension_multipleCommands_v06} with premium labels. */ @@ -485,49 +485,49 @@ public class DomainCheckFlowTest public void testFeeExtension_premiumLabels_v06() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v06.xml")); } @Test public void testFeeExtension_premiumLabels_v11_create() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v11_create.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_create.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v11_create.xml")); } @Test public void testFeeExtension_premiumLabels_v11_renew() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v11_renew.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_renew.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v11_renew.xml")); } @Test public void testFeeExtension_premiumLabels_v11_transfer() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v11_transfer.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_transfer.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v11_transfer.xml")); } @Test public void testFeeExtension_premiumLabels_v11_restore() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v11_restore.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_restore.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v11_restore.xml")); } @Test public void testFeeExtension_premiumLabels_v11_update() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v11_update.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_update.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v11_update.xml")); } @Test public void testFeeExtension_premiumLabels_v12() throws Exception { createTld("example"); setEppInput("domain_check_fee_premium_v12.xml"); - runFlowAssertResponse(readFile("domain_check_fee_premium_response_v12.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_premium_response_v12.xml")); } @Test @@ -539,7 +539,7 @@ public class DomainCheckFlowTest .setCreateBillingCost(Money.of(CurrencyUnit.USD, 11.1)) .build()); setEppInput("domain_check_fee_fractional.xml"); - runFlowAssertResponse(readFile("domain_check_fee_fractional_response.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_fractional_response.xml")); } /** Test that create fees are properly omitted/classed on names on reserved lists. */ @@ -550,7 +550,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v06.xml")); } /** The tests must be split up for version 11, which allows only one command at a time. */ @@ -561,7 +561,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_create.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_create.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v11_create.xml")); } @Test @@ -571,7 +571,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_renew.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_renew.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v11_renew.xml")); } @Test @@ -581,7 +581,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_transfer.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_transfer.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v11_transfer.xml")); } @Test @@ -591,7 +591,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_restore.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_restore.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v11_restore.xml")); } @Test @@ -601,7 +601,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v12.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v12.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_response_v12.xml")); } @Test @@ -612,7 +612,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v06.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v06.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v06.xml")); } @Test @@ -624,7 +624,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_create.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_create.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v11_create.xml")); } @Test @@ -636,7 +636,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_renew.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_renew.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v11_renew.xml")); } @Test @@ -648,7 +648,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_transfer.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_transfer.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v11_transfer.xml")); } @Test @@ -660,7 +660,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v11_restore.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_restore.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v11_restore.xml")); } @Test @@ -671,7 +671,7 @@ public class DomainCheckFlowTest .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) .build()); setEppInput("domain_check_fee_reserved_v12.xml"); - runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v12.xml")); + runFlowAssertResponse(loadFile("domain_check_fee_reserved_sunrise_response_v12.xml")); } @Test @@ -861,7 +861,7 @@ public class DomainCheckFlowTest clock.nowUtc().plusDays(2), Money.of(USD, 0))) .build()); setEppInput(inputFile); - runFlowAssertResponse(readFile(outputFile)); + runFlowAssertResponse(loadFile(outputFile)); } @Test diff --git a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java index 3c22047fe..a33a8f333 100644 --- a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java @@ -52,7 +52,7 @@ public class DomainClaimsCheckFlowTest assertTransactionalFlow(false); assertNoHistory(); // Checks don't create a history event. assertNoBillingEvents(); // Checks are always free. - runFlowAssertResponse(readFile(expectedXmlFilename)); + runFlowAssertResponse(loadFile(expectedXmlFilename)); } @Test @@ -130,7 +130,7 @@ public class DomainClaimsCheckFlowTest assertNoHistory(); // Checks don't create a history event. assertNoBillingEvents(); // Checks are always free. runFlowAssertResponse( - CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_check_claims_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_check_claims_response.xml")); } @Test diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index c2f0ee66f..f45715e09 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -48,7 +48,6 @@ import static google.registry.testing.TaskQueueHelper.assertDnsTasksEnqueued; import static google.registry.testing.TaskQueueHelper.assertNoDnsTasksEnqueued; import static google.registry.testing.TaskQueueHelper.assertNoTasksEnqueued; import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; import static google.registry.tmch.LordnTask.QUEUE_CLAIMS; import static google.registry.tmch.LordnTask.QUEUE_SUNRISE; import static google.registry.util.DateTimeUtils.END_OF_TIME; @@ -331,7 +330,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase substitutions) throws Exception { assertTransactionalFlow(true); runFlowAssertResponse( - CommitMode.LIVE, userPrivileges, readFile(responseXmlFile, substitutions)); + CommitMode.LIVE, userPrivileges, loadFile(responseXmlFile, substitutions)); assertSuccessfulCreate(domainTld, false); assertNoLordn(); } @@ -358,7 +357,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase originalGracePeriods = domain.getGracePeriods(); TransferData originalTransferData = domain.getTransferData(); - runFlowAssertResponse(readFile(expectedXmlFilename)); + runFlowAssertResponse(loadFile(expectedXmlFilename)); // Transfer should have been cancelled. Verify correct fields were set. domain = reloadResourceByForeignKey(); @@ -184,7 +184,7 @@ public class DomainTransferCancelFlowTest public void testDryRun() throws Exception { setEppInput("domain_transfer_cancel.xml"); eppLoader.replaceAll("JD1234-REP", contact.getRepoId()); - dryRunFlowAssertResponse(readFile("domain_transfer_cancel_response.xml")); + dryRunFlowAssertResponse(loadFile("domain_transfer_cancel_response.xml")); } @Test @@ -314,7 +314,7 @@ public class DomainTransferCancelFlowTest loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); clock.advanceOneMilli(); runFlowAssertResponse( - CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_cancel_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_transfer_cancel_response.xml")); } // NB: No need to test pending delete status since pending transfers will get cancelled upon diff --git a/javatests/google/registry/flows/domain/DomainTransferQueryFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferQueryFlowTest.java index 3e395316d..54e7d39f4 100644 --- a/javatests/google/registry/flows/domain/DomainTransferQueryFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferQueryFlowTest.java @@ -53,7 +53,7 @@ public class DomainTransferQueryFlowTest eppLoader.replaceAll("JD1234-REP", contact.getRepoId()); // Setup done; run the test. assertTransactionalFlow(false); - runFlowAssertResponse(readFile(expectedXmlFilename)); + runFlowAssertResponse(loadFile(expectedXmlFilename)); assertAboutDomains().that(domain).hasOneHistoryEntryEachOfTypes( HistoryEntry.Type.DOMAIN_CREATE, HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST); diff --git a/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java index 1d1233b8a..500ff9140 100644 --- a/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java @@ -90,7 +90,7 @@ public class DomainTransferRejectFlowTest DateTime originalExpirationTime = domain.getRegistrationExpirationTime(); ImmutableSet originalGracePeriods = domain.getGracePeriods(); TransferData originalTransferData = domain.getTransferData(); - runFlowAssertResponse(readFile(expectedXmlFilename)); + runFlowAssertResponse(loadFile(expectedXmlFilename)); // Transfer should have been rejected. Verify correct fields were set. domain = reloadResourceByForeignKey(); assertTransferFailed(domain, TransferStatus.CLIENT_REJECTED, originalTransferData); @@ -155,7 +155,7 @@ public class DomainTransferRejectFlowTest public void testDryRun() throws Exception { setEppInput("domain_transfer_reject.xml"); eppLoader.replaceAll("JD1234-REP", contact.getRepoId()); - dryRunFlowAssertResponse(readFile("domain_transfer_reject_response.xml")); + dryRunFlowAssertResponse(loadFile("domain_transfer_reject_response.xml")); } @Test @@ -183,7 +183,7 @@ public class DomainTransferRejectFlowTest persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); runFlowAssertResponse( - CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_reject_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_transfer_reject_response.xml")); } @Test diff --git a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java index 0763c0216..cdcab9120 100644 --- a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java @@ -210,7 +210,7 @@ public class DomainTransferRequestFlowTest DateTime implicitTransferTime = clock.nowUtc().plus(registry.getAutomaticTransferLength()); // Setup done; run the test. assertTransactionalFlow(true); - runFlowAssertResponse(readFile(expectedXmlFilename, substitutions)); + runFlowAssertResponse(loadFile(expectedXmlFilename, substitutions)); // Transfer should have been requested. domain = reloadResourceByForeignKey(); // Verify that HistoryEntry was created. @@ -512,7 +512,7 @@ public class DomainTransferRequestFlowTest // Setup done; run the test. assertTransactionalFlow(true); runFlowAssertResponse( - CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile(expectedXmlFilename, substitutions)); + CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile(expectedXmlFilename, substitutions)); if (expectedAutomaticTransferLength.equals(Duration.ZERO)) { // The transfer is going to happen immediately. To observe the domain in the pending transfer @@ -583,7 +583,7 @@ public class DomainTransferRequestFlowTest setupDomain("example", "tld"); setEppInput("domain_transfer_request.xml"); eppLoader.replaceAll("JD1234-REP", contact.getRepoId()); - dryRunFlowAssertResponse(readFile("domain_transfer_request_response.xml")); + dryRunFlowAssertResponse(loadFile("domain_transfer_request_response.xml")); } @Test diff --git a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java index d20bb08e3..b46dd6cc4 100644 --- a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java @@ -142,7 +142,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase { @Test public void testDryRun() throws Exception { persistOneTimePollMessage(MESSAGE_ID); - dryRunFlowAssertResponse(readFile("poll_ack_response_empty.xml")); + dryRunFlowAssertResponse(loadFile("poll_ack_response_empty.xml")); } @Test @@ -97,21 +97,21 @@ public class PollAckFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(contact)) .build()); assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_ack_response_empty.xml")); } @Test public void testSuccess_messageOnContactResource() throws Exception { persistOneTimePollMessage(MESSAGE_ID); assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_ack_response_empty.xml")); } @Test public void testSuccess_recentActiveAutorenew() throws Exception { persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), END_OF_TIME); assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_ack_response_empty.xml")); } @Test @@ -123,14 +123,14 @@ public class PollAckFlowTest extends FlowTestCase { persistOneTimePollMessage(MESSAGE_ID + i); } assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response.xml")); + runFlowAssertResponse(loadFile("poll_ack_response.xml")); } @Test public void testSuccess_oldInactiveAutorenew() throws Exception { persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), clock.nowUtc()); assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_ack_response_empty.xml")); } @Test @@ -140,7 +140,7 @@ public class PollAckFlowTest extends FlowTestCase { persistOneTimePollMessage(MESSAGE_ID + i); } assertTransactionalFlow(true); - runFlowAssertResponse(readFile("poll_ack_response.xml")); + runFlowAssertResponse(loadFile("poll_ack_response.xml")); } @Test diff --git a/javatests/google/registry/flows/poll/PollRequestFlowTest.java b/javatests/google/registry/flows/poll/PollRequestFlowTest.java index b61bd1f86..7f0a364c4 100644 --- a/javatests/google/registry/flows/poll/PollRequestFlowTest.java +++ b/javatests/google/registry/flows/poll/PollRequestFlowTest.java @@ -75,7 +75,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(domain)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_domain_transfer.xml")); + runFlowAssertResponse(loadFile("poll_response_domain_transfer.xml")); } @Test @@ -99,7 +99,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(contact)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_contact_transfer.xml")); + runFlowAssertResponse(loadFile("poll_response_contact_transfer.xml")); } @Test @@ -114,7 +114,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(domain)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_domain_pending_notification.xml")); + runFlowAssertResponse(loadFile("poll_response_domain_pending_notification.xml")); } @Test @@ -128,12 +128,12 @@ public class PollRequestFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(domain)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_autorenew.xml")); + runFlowAssertResponse(loadFile("poll_response_autorenew.xml")); } @Test public void testSuccess_empty() throws Exception { - runFlowAssertResponse(readFile("poll_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_response_empty.xml")); } @Test @@ -145,7 +145,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setMsg("Poll message") .setParent(createHistoryEntryForEppResource(domain)) .build()); - runFlowAssertResponse(readFile("poll_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_response_empty.xml")); } @Test @@ -157,7 +157,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setMsg("Poll message") .setParent(createHistoryEntryForEppResource(domain)) .build()); - runFlowAssertResponse(readFile("poll_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_response_empty.xml")); } @Test @@ -171,7 +171,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setParent(createHistoryEntryForEppResource(domain)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_empty.xml")); + runFlowAssertResponse(loadFile("poll_response_empty.xml")); } @Test @@ -192,7 +192,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setEventTime(clock.nowUtc().minusDays(1)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_contact_delete.xml")); + runFlowAssertResponse(loadFile("poll_response_contact_delete.xml")); } @Test @@ -213,7 +213,7 @@ public class PollRequestFlowTest extends FlowTestCase { .setEventTime(clock.nowUtc().minusDays(1)) .build()); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("poll_response_host_delete.xml")); + runFlowAssertResponse(loadFile("poll_response_host_delete.xml")); } @Test diff --git a/javatests/google/registry/flows/session/HelloFlowTest.java b/javatests/google/registry/flows/session/HelloFlowTest.java index f125af7fc..cde115e82 100644 --- a/javatests/google/registry/flows/session/HelloFlowTest.java +++ b/javatests/google/registry/flows/session/HelloFlowTest.java @@ -14,7 +14,6 @@ package google.registry.flows.session; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis; import com.google.common.collect.ImmutableMap; @@ -29,9 +28,7 @@ public class HelloFlowTest extends FlowTestCase { setEppInput("hello.xml"); assertTransactionalFlow(false); runFlowAssertResponse( - loadFileWithSubstitutions( - getClass(), - "greeting.xml", - ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis())))); + loadFile( + "greeting.xml", ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis())))); } } diff --git a/javatests/google/registry/flows/session/LoginFlowTestCase.java b/javatests/google/registry/flows/session/LoginFlowTestCase.java index 5e6d1095f..d7dfda43c 100644 --- a/javatests/google/registry/flows/session/LoginFlowTestCase.java +++ b/javatests/google/registry/flows/session/LoginFlowTestCase.java @@ -56,7 +56,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase { void doSuccessfulTest(String xmlFilename) throws Exception { setEppInput(xmlFilename); assertTransactionalFlow(false); - runFlowAssertResponse(readFile("login_response.xml")); + runFlowAssertResponse(loadFile("login_response.xml")); } // Also called in subclasses. diff --git a/javatests/google/registry/flows/session/LogoutFlowTest.java b/javatests/google/registry/flows/session/LogoutFlowTest.java index c3a77a265..d8e01d8e1 100644 --- a/javatests/google/registry/flows/session/LogoutFlowTest.java +++ b/javatests/google/registry/flows/session/LogoutFlowTest.java @@ -37,7 +37,7 @@ public class LogoutFlowTest extends FlowTestCase { public void testSuccess() throws Exception { assertTransactionalFlow(false); // All flow tests are implicitly logged in, so logout should work. - runFlowAssertResponse(readFile("logout_response.xml")); + runFlowAssertResponse(loadFile("logout_response.xml")); } @Test diff --git a/javatests/google/registry/rdap/RdapActionBaseTest.java b/javatests/google/registry/rdap/RdapActionBaseTest.java index 8c6925ff5..bea2730b2 100644 --- a/javatests/google/registry/rdap/RdapActionBaseTest.java +++ b/javatests/google/registry/rdap/RdapActionBaseTest.java @@ -19,7 +19,7 @@ import static com.google.common.truth.Truth.assertThat; import static google.registry.request.Action.Method.GET; import static google.registry.request.Action.Method.HEAD; import static google.registry.testing.DatastoreHelper.createTld; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -166,7 +166,7 @@ public class RdapActionBaseTest { @Test public void testValidName_works() throws Exception { assertThat(generateActualJson("no.thing")).isEqualTo(JSONValue.parse( - loadFileWithSubstitutions(this.getClass(), "rdapjson_toplevel.json", null))); + loadFile(this.getClass(), "rdapjson_toplevel.json"))); assertThat(response.getStatus()).isEqualTo(200); } @@ -234,7 +234,7 @@ public class RdapActionBaseTest { } private String loadFileWithoutTrailingNewline(String fileName) { - String contents = loadFileWithSubstitutions(this.getClass(), fileName, null); + String contents = loadFile(this.getClass(), fileName); return contents.endsWith("\n") ? contents.substring(0, contents.length() - 1) : contents; } diff --git a/javatests/google/registry/rdap/RdapDomainActionTest.java b/javatests/google/registry/rdap/RdapDomainActionTest.java index d5d164012..ecfa9a640 100644 --- a/javatests/google/registry/rdap/RdapDomainActionTest.java +++ b/javatests/google/registry/rdap/RdapDomainActionTest.java @@ -24,7 +24,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResou import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -341,8 +341,7 @@ public class RdapDomainActionTest { substitutionsBuilder.put("NAMESERVER2PUNYCODENAME", "ns2.cat.lol"); } return JSONValue.parse( - loadFileWithSubstitutions( - this.getClass(), expectedOutputFile, substitutionsBuilder.build())); + loadFile(this.getClass(), expectedOutputFile, substitutionsBuilder.build())); } private Object generateExpectedJsonWithTopLevelEntries( diff --git a/javatests/google/registry/rdap/RdapDomainSearchActionTest.java b/javatests/google/registry/rdap/RdapDomainSearchActionTest.java index e1e09aeaa..1b0c8eee9 100644 --- a/javatests/google/registry/rdap/RdapDomainSearchActionTest.java +++ b/javatests/google/registry/rdap/RdapDomainSearchActionTest.java @@ -30,7 +30,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResou import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -405,7 +405,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase { String domain1Handle, String domain2Name, String domain2Handle) { - return JSONValue.parse(loadFileWithSubstitutions( + return JSONValue.parse(loadFile( this.getClass(), "rdap_domains_two.json", ImmutableMap.of( @@ -427,7 +427,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase { String domain4Handle, String expectedOutputFile) { return JSONValue.parse( - loadFileWithSubstitutions( + loadFile( this.getClass(), expectedOutputFile, new ImmutableMap.Builder() @@ -481,8 +481,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase { } } return JSONValue.parse( - loadFileWithSubstitutions( - this.getClass(), expectedOutputFile, substitutionsBuilder.build())); + loadFile(this.getClass(), expectedOutputFile, substitutionsBuilder.build())); } private Object generateExpectedJsonForDomain( @@ -568,7 +567,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase { String domainHandle3, String domainName4, String domainHandle4) { - return JSONValue.parse(loadFileWithSubstitutions( + return JSONValue.parse(loadFile( this.getClass(), fileName, new ImmutableMap.Builder() diff --git a/javatests/google/registry/rdap/RdapEntityActionTest.java b/javatests/google/registry/rdap/RdapEntityActionTest.java index 0a9fcb21d..eebdcc8f7 100644 --- a/javatests/google/registry/rdap/RdapEntityActionTest.java +++ b/javatests/google/registry/rdap/RdapEntityActionTest.java @@ -24,7 +24,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResou import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -221,7 +221,7 @@ public class RdapEntityActionTest { @Nullable String address, String expectedOutputFile) { return JSONValue.parse( - loadFileWithSubstitutions( + loadFile( this.getClass(), expectedOutputFile, new ImmutableMap.Builder() diff --git a/javatests/google/registry/rdap/RdapEntitySearchActionTest.java b/javatests/google/registry/rdap/RdapEntitySearchActionTest.java index 61bc7f22a..5474eb231 100644 --- a/javatests/google/registry/rdap/RdapEntitySearchActionTest.java +++ b/javatests/google/registry/rdap/RdapEntitySearchActionTest.java @@ -28,7 +28,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistD import static google.registry.testing.FullFieldsTestEntityHelper.makeContactResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -180,10 +180,8 @@ public class RdapEntitySearchActionTest extends RdapSearchActionTestCase { } private Object generateExpectedJson(String expectedOutputFile) { - return JSONValue.parse(loadFileWithSubstitutions( - this.getClass(), - expectedOutputFile, - ImmutableMap.of("TYPE", "entity"))); + return JSONValue.parse( + loadFile(this.getClass(), expectedOutputFile, ImmutableMap.of("TYPE", "entity"))); } private Object generateExpectedJson( @@ -212,8 +210,7 @@ public class RdapEntitySearchActionTest extends RdapSearchActionTestCase { } builder.put("TYPE", "entity"); builder.put("STATUS", status); - String substitutedFile = - loadFileWithSubstitutions(this.getClass(), expectedOutputFile, builder.build()); + String substitutedFile = loadFile(this.getClass(), expectedOutputFile, builder.build()); Object jsonObject = JSONValue.parse(substitutedFile); checkNotNull(jsonObject, "substituted file is not valid JSON: %s", substitutedFile); return jsonObject; diff --git a/javatests/google/registry/rdap/RdapHelpActionTest.java b/javatests/google/registry/rdap/RdapHelpActionTest.java index 27d021d62..abc8fd208 100644 --- a/javatests/google/registry/rdap/RdapHelpActionTest.java +++ b/javatests/google/registry/rdap/RdapHelpActionTest.java @@ -15,7 +15,7 @@ package google.registry.rdap; import static com.google.common.truth.Truth.assertThat; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -85,8 +85,8 @@ public class RdapHelpActionTest { } private Object generateExpectedJson(String name, String expectedOutputFile) { - return JSONValue.parse(loadFileWithSubstitutions( - this.getClass(), expectedOutputFile, ImmutableMap.of("NAME", name))); + return JSONValue.parse( + loadFile(this.getClass(), expectedOutputFile, ImmutableMap.of("NAME", name))); } @Test diff --git a/javatests/google/registry/rdap/RdapJsonFormatterTest.java b/javatests/google/registry/rdap/RdapJsonFormatterTest.java index 9a9baec3d..5a02c5bcb 100644 --- a/javatests/google/registry/rdap/RdapJsonFormatterTest.java +++ b/javatests/google/registry/rdap/RdapJsonFormatterTest.java @@ -23,7 +23,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistH import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; import com.google.common.collect.ImmutableList; @@ -260,7 +260,7 @@ public class RdapJsonFormatterTest { } private Object loadJson(String expectedFileName) { - return JSONValue.parse(loadFileWithSubstitutions(this.getClass(), expectedFileName, null)); + return JSONValue.parse(loadFile(this.getClass(), expectedFileName)); } @Test diff --git a/javatests/google/registry/rdap/RdapNameserverActionTest.java b/javatests/google/registry/rdap/RdapNameserverActionTest.java index 2c0391071..024341969 100644 --- a/javatests/google/registry/rdap/RdapNameserverActionTest.java +++ b/javatests/google/registry/rdap/RdapNameserverActionTest.java @@ -19,7 +19,7 @@ import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.persistResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -160,7 +160,7 @@ public class RdapNameserverActionTest { if (!punycodeSet) { builder.put("PUNYCODENAME", name); } - return JSONValue.parse(loadFileWithSubstitutions( + return JSONValue.parse(loadFile( this.getClass(), expectedOutputFile, builder.build())); diff --git a/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java b/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java index c9a794b6a..eab7efb97 100644 --- a/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java +++ b/javatests/google/registry/rdap/RdapNameserverSearchActionTest.java @@ -28,7 +28,7 @@ import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResou import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar; import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -217,7 +217,7 @@ public class RdapNameserverSearchActionTest extends RdapSearchActionTestCase { builder.put("STATUS", "active"); builder.put("TYPE", "nameserver"); return JSONValue.parse( - loadFileWithSubstitutions(this.getClass(), expectedOutputFile, builder.build())); + loadFile(this.getClass(), expectedOutputFile, builder.build())); } private Object generateExpectedJsonForNameserver( diff --git a/javatests/google/registry/rde/BrdaCopyActionTest.java b/javatests/google/registry/rde/BrdaCopyActionTest.java index 5d4423fcc..177cfc1f3 100644 --- a/javatests/google/registry/rde/BrdaCopyActionTest.java +++ b/javatests/google/registry/rde/BrdaCopyActionTest.java @@ -56,7 +56,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class BrdaCopyActionTest extends ShardableTestCase { - private static final ByteSource DEPOSIT_XML = RdeTestData.get("deposit_full.xml"); // 2010-10-17 + private static final ByteSource DEPOSIT_XML = RdeTestData.loadBytes("deposit_full.xml"); private static final GcsFilename STAGE_FILE = new GcsFilename("keg", "lol_2010-10-17_thin_S1_R0.xml.ghostryde"); @@ -77,8 +77,8 @@ public class BrdaCopyActionTest extends ShardableTestCase { @Rule public final GpgSystemCommandRule gpg = new GpgSystemCommandRule( - RdeTestData.get("pgp-public-keyring.asc"), - RdeTestData.get("pgp-private-keyring-escrow.asc")); + RdeTestData.loadBytes("pgp-public-keyring.asc"), + RdeTestData.loadBytes("pgp-private-keyring-escrow.asc")); private static PGPPublicKey encryptKey; private static PGPPrivateKey decryptKey; diff --git a/javatests/google/registry/rde/GhostrydeGpgIntegrationTest.java b/javatests/google/registry/rde/GhostrydeGpgIntegrationTest.java index dc8115be7..2b29b3d1e 100644 --- a/javatests/google/registry/rde/GhostrydeGpgIntegrationTest.java +++ b/javatests/google/registry/rde/GhostrydeGpgIntegrationTest.java @@ -53,8 +53,8 @@ public class GhostrydeGpgIntegrationTest extends ShardableTestCase { @Rule public final GpgSystemCommandRule gpg = new GpgSystemCommandRule( - RdeTestData.get("pgp-public-keyring.asc"), - RdeTestData.get("pgp-private-keyring-registry.asc")); + RdeTestData.loadBytes("pgp-public-keyring.asc"), + RdeTestData.loadBytes("pgp-private-keyring-registry.asc")); @DataPoints public static GpgCommand[] commands = new GpgCommand[] { diff --git a/javatests/google/registry/rde/RdeReportActionTest.java b/javatests/google/registry/rde/RdeReportActionTest.java index 75da26bfe..847777d7f 100644 --- a/javatests/google/registry/rde/RdeReportActionTest.java +++ b/javatests/google/registry/rde/RdeReportActionTest.java @@ -74,9 +74,9 @@ import org.mockito.ArgumentCaptor; @RunWith(JUnit4.class) public class RdeReportActionTest { - private static final ByteSource REPORT_XML = RdeTestData.get("report.xml"); - private static final ByteSource IIRDEA_BAD_XML = RdeTestData.get("iirdea_bad.xml"); - private static final ByteSource IIRDEA_GOOD_XML = RdeTestData.get("iirdea_good.xml"); + private static final ByteSource REPORT_XML = RdeTestData.loadBytes("report.xml"); + private static final ByteSource IIRDEA_BAD_XML = RdeTestData.loadBytes("iirdea_bad.xml"); + private static final ByteSource IIRDEA_GOOD_XML = RdeTestData.loadBytes("iirdea_good.xml"); @Rule public final ExceptionRule thrown = new ExceptionRule(); diff --git a/javatests/google/registry/rde/RdeTestData.java b/javatests/google/registry/rde/RdeTestData.java index f7c7bda6b..f07117bbb 100644 --- a/javatests/google/registry/rde/RdeTestData.java +++ b/javatests/google/registry/rde/RdeTestData.java @@ -21,14 +21,14 @@ import google.registry.testing.TestDataHelper; public final class RdeTestData { /** Returns {@link ByteSource} for file in {@code rde/testdata/} directory. */ - public static ByteSource get(String filename) { + public static ByteSource loadBytes(String filename) { return TestDataHelper.loadBytes(RdeTestData.class, filename); } /** * Loads data from file in {@code rde/testdata/} as a String (assuming file is UTF-8). */ - public static String loadUtf8(String filename) { + public static String loadFile(String filename) { return TestDataHelper.loadFile(RdeTestData.class, filename); } } diff --git a/javatests/google/registry/rde/RdeUploadActionTest.java b/javatests/google/registry/rde/RdeUploadActionTest.java index 85fe903b8..f50769fa5 100644 --- a/javatests/google/registry/rde/RdeUploadActionTest.java +++ b/javatests/google/registry/rde/RdeUploadActionTest.java @@ -97,8 +97,8 @@ import org.mockito.stubbing.OngoingStubbing; public class RdeUploadActionTest { private static final int BUFFER_SIZE = 64 * 1024; - private static final ByteSource REPORT_XML = RdeTestData.get("report.xml"); - private static final ByteSource DEPOSIT_XML = RdeTestData.get("deposit_full.xml"); // 2010-10-17 + private static final ByteSource REPORT_XML = RdeTestData.loadBytes("report.xml"); + private static final ByteSource DEPOSIT_XML = RdeTestData.loadBytes("deposit_full.xml"); private static final GcsFilename GHOSTRYDE_FILE = new GcsFilename("bucket", "tld_2010-10-17_full_S1_R0.xml.ghostryde"); @@ -128,8 +128,8 @@ public class RdeUploadActionTest { @Rule public final GpgSystemCommandRule gpg = new GpgSystemCommandRule( - RdeTestData.get("pgp-public-keyring.asc"), - RdeTestData.get("pgp-private-keyring-escrow.asc")); + RdeTestData.loadBytes("pgp-public-keyring.asc"), + RdeTestData.loadBytes("pgp-private-keyring-escrow.asc")); @Rule public final IoSpyRule ioSpy = new IoSpyRule() diff --git a/javatests/google/registry/rde/RydeGpgIntegrationTest.java b/javatests/google/registry/rde/RydeGpgIntegrationTest.java index 50dbba4d5..4ef58a7b0 100644 --- a/javatests/google/registry/rde/RydeGpgIntegrationTest.java +++ b/javatests/google/registry/rde/RydeGpgIntegrationTest.java @@ -57,8 +57,8 @@ public class RydeGpgIntegrationTest extends ShardableTestCase { @Rule public final GpgSystemCommandRule gpg = new GpgSystemCommandRule( - RdeTestData.get("pgp-public-keyring.asc"), - RdeTestData.get("pgp-private-keyring-escrow.asc")); + RdeTestData.loadBytes("pgp-public-keyring.asc"), + RdeTestData.loadBytes("pgp-private-keyring-escrow.asc")); private final FakeKeyringModule keyringFactory = new FakeKeyringModule(); diff --git a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java b/javatests/google/registry/rde/imports/RdeContactImportActionTest.java index ed826392d..5765c99ed 100644 --- a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeContactImportActionTest.java @@ -54,7 +54,7 @@ import org.junit.runners.JUnit4; public class RdeContactImportActionTest extends MapreduceTestCase { private static final ByteSource DEPOSIT_1_CONTACT = - RdeImportsTestData.get("deposit_1_contact.xml"); + RdeImportsTestData.loadBytes("deposit_1_contact.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeContactInputTest.java b/javatests/google/registry/rde/imports/RdeContactInputTest.java index 359c68063..d1bf16db9 100644 --- a/javatests/google/registry/rde/imports/RdeContactInputTest.java +++ b/javatests/google/registry/rde/imports/RdeContactInputTest.java @@ -40,17 +40,17 @@ import org.junit.runners.JUnit4; public class RdeContactInputTest { private static final ByteSource DEPOSIT_0_CONTACT = - RdeImportsTestData.get("deposit_0_contact_header.xml"); + RdeImportsTestData.loadBytes("deposit_0_contact_header.xml"); private static final ByteSource DEPOSIT_1_CONTACT = - RdeImportsTestData.get("deposit_1_contact.xml"); + RdeImportsTestData.loadBytes("deposit_1_contact.xml"); private static final ByteSource DEPOSIT_199_CONTACT = - RdeImportsTestData.get("deposit_199_contact_header.xml"); + RdeImportsTestData.loadBytes("deposit_199_contact_header.xml"); private static final ByteSource DEPOSIT_200_CONTACT = - RdeImportsTestData.get("deposit_200_contact_header.xml"); + RdeImportsTestData.loadBytes("deposit_200_contact_header.xml"); private static final ByteSource DEPOSIT_1000_CONTACT = - RdeImportsTestData.get("deposit_1000_contact_header.xml"); + RdeImportsTestData.loadBytes("deposit_1000_contact_header.xml"); private static final ByteSource DEPOSIT_10000_CONTACT = - RdeImportsTestData.get("deposit_10000_contact_header.xml"); + RdeImportsTestData.loadBytes("deposit_10000_contact_header.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeContactReaderTest.java b/javatests/google/registry/rde/imports/RdeContactReaderTest.java index 840cc9274..21ad8b961 100644 --- a/javatests/google/registry/rde/imports/RdeContactReaderTest.java +++ b/javatests/google/registry/rde/imports/RdeContactReaderTest.java @@ -47,13 +47,13 @@ import org.junit.runners.JUnit4; public class RdeContactReaderTest { private static final ByteSource DEPOSIT_1_CONTACT = - RdeImportsTestData.get("deposit_1_contact.xml"); + RdeImportsTestData.loadBytes("deposit_1_contact.xml"); private static final ByteSource DEPOSIT_3_CONTACT = - RdeImportsTestData.get("deposit_3_contact.xml"); + RdeImportsTestData.loadBytes("deposit_3_contact.xml"); private static final ByteSource DEPOSIT_4_CONTACT = - RdeImportsTestData.get("deposit_4_contact.xml"); + RdeImportsTestData.loadBytes("deposit_4_contact.xml"); private static final ByteSource DEPOSIT_10_CONTACT = - RdeImportsTestData.get("deposit_10_contact.xml"); + RdeImportsTestData.loadBytes("deposit_10_contact.xml"); private static final String IMPORT_BUCKET_NAME = "rde-import"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java b/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java index e962f5cf5..fe15d3473 100644 --- a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java @@ -68,11 +68,12 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeDomainImportActionTest extends MapreduceTestCase { - private static final ByteSource DEPOSIT_1_DOMAIN = RdeImportsTestData.get("deposit_1_domain.xml"); + private static final ByteSource DEPOSIT_1_DOMAIN = + RdeImportsTestData.loadBytes("deposit_1_domain.xml"); private static final ByteSource DEPOSIT_1_DOMAIN_PENDING_TRANSFER = - RdeImportsTestData.get("deposit_1_domain_pending_transfer.xml"); + RdeImportsTestData.loadBytes("deposit_1_domain_pending_transfer.xml"); private static final ByteSource DEPOSIT_1_DOMAIN_PENDING_TRANSFER_REG_CAP = - RdeImportsTestData.get("deposit_1_domain_pending_transfer_registration_cap.xml"); + RdeImportsTestData.loadBytes("deposit_1_domain_pending_transfer_registration_cap.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeDomainReaderTest.java b/javatests/google/registry/rde/imports/RdeDomainReaderTest.java index 1327a728d..04413f63d 100644 --- a/javatests/google/registry/rde/imports/RdeDomainReaderTest.java +++ b/javatests/google/registry/rde/imports/RdeDomainReaderTest.java @@ -15,6 +15,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.persistActiveContact; @@ -49,11 +50,10 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeDomainReaderTest { - private static final ByteSource DEPOSIT_1_DOMAIN = RdeImportsTestData.get("deposit_1_domain.xml"); - private static final ByteSource DEPOSIT_3_DOMAIN = RdeImportsTestData.get("deposit_3_domain.xml"); - private static final ByteSource DEPOSIT_4_DOMAIN = RdeImportsTestData.get("deposit_4_domain.xml"); - private static final ByteSource DEPOSIT_10_DOMAIN = - RdeImportsTestData.get("deposit_10_domain.xml"); + private static final ByteSource DEPOSIT_1_DOMAIN = loadBytes("deposit_1_domain.xml"); + private static final ByteSource DEPOSIT_3_DOMAIN = loadBytes("deposit_3_domain.xml"); + private static final ByteSource DEPOSIT_4_DOMAIN = loadBytes("deposit_4_domain.xml"); + private static final ByteSource DEPOSIT_10_DOMAIN = loadBytes("deposit_10_domain.xml"); private static final String IMPORT_BUCKET_NAME = "rde-import"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java b/javatests/google/registry/rde/imports/RdeHostImportActionTest.java index 69c5480c9..398b52490 100644 --- a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeHostImportActionTest.java @@ -16,6 +16,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ofy.ObjectifyService.ofy; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import static google.registry.testing.DatastoreHelper.getHistoryEntries; import static google.registry.testing.DatastoreHelper.newHostResource; import static google.registry.testing.DatastoreHelper.persistResource; @@ -53,7 +54,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeHostImportActionTest extends MapreduceTestCase { - private static final ByteSource DEPOSIT_1_HOST = RdeImportsTestData.get("deposit_1_host.xml"); + private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeHostInputTest.java b/javatests/google/registry/rde/imports/RdeHostInputTest.java index 090e6ef81..07912d692 100644 --- a/javatests/google/registry/rde/imports/RdeHostInputTest.java +++ b/javatests/google/registry/rde/imports/RdeHostInputTest.java @@ -15,6 +15,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import com.google.appengine.tools.cloudstorage.GcsFilename; import com.google.appengine.tools.cloudstorage.GcsService; @@ -40,17 +41,12 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeHostInputTest { - private static final ByteSource DEPOSIT_0_HOST = - RdeImportsTestData.get("deposit_0_host_header.xml"); - private static final ByteSource DEPOSIT_1_HOST = RdeImportsTestData.get("deposit_1_host.xml"); - private static final ByteSource DEPOSIT_199_HOST = - RdeImportsTestData.get("deposit_199_host_header.xml"); - private static final ByteSource DEPOSIT_200_HOST = - RdeImportsTestData.get("deposit_200_host_header.xml"); - private static final ByteSource DEPOSIT_1000_HOST = - RdeImportsTestData.get("deposit_1000_host_header.xml"); - private static final ByteSource DEPOSIT_10000_HOST = - RdeImportsTestData.get("deposit_10000_host_header.xml"); + private static final ByteSource DEPOSIT_0_HOST = loadBytes("deposit_0_host_header.xml"); + private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml"); + private static final ByteSource DEPOSIT_199_HOST = loadBytes("deposit_199_host_header.xml"); + private static final ByteSource DEPOSIT_200_HOST = loadBytes("deposit_200_host_header.xml"); + private static final ByteSource DEPOSIT_1000_HOST = loadBytes("deposit_1000_host_header.xml"); + private static final ByteSource DEPOSIT_10000_HOST = loadBytes("deposit_10000_host_header.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; @@ -220,7 +216,7 @@ public class RdeHostInputTest { /** * Verify bucket, filename, offset and max results for a specific reader * - * @param numberOfShards Number of desired shards ({@link Optional#absent} uses default of 50) + * @param numberOfShards Number of desired shards ({@link Optional#empty} uses default of 50) * @param whichReader Index of the reader in the list that is produced by the {@link RdeHostInput} * @param expectedOffset Expected offset of the reader * @param expectedMaxResults Expected maxResults of the reader @@ -248,7 +244,7 @@ public class RdeHostInputTest { /** * Verify the number of readers produced by the {@link RdeHostInput} * - * @param numberOfShards Number of desired shards ({@link Optional#absent} uses default of 50) + * @param numberOfShards Number of desired shards ({@link Optional#empty} uses default of 50) * @param expectedNumberOfReaders Expected size of the list returned */ private void assertNumberOfReaders(Optional numberOfShards, int expectedNumberOfReaders) @@ -260,7 +256,7 @@ public class RdeHostInputTest { /** * Creates a new testable instance of {@link RdeHostInput} - * @param mapShards Number of desired shards ({@link Optional#absent} uses default of 50) + * @param mapShards Number of desired shards ({@link Optional#empty} uses default of 50) */ private RdeHostInput getInput(Optional mapShards) { return new RdeHostInput(mapShards, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME); diff --git a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java b/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java index 42fb5f592..52f5b541f 100644 --- a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java +++ b/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java @@ -17,6 +17,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE; import static google.registry.model.ofy.ObjectifyService.ofy; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.newDomainResource; import static google.registry.testing.DatastoreHelper.newHostResource; @@ -60,7 +61,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeHostLinkActionTest extends MapreduceTestCase { - private static final ByteSource DEPOSIT_1_HOST = RdeImportsTestData.get("deposit_1_host.xml"); + private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml"); private static final String IMPORT_BUCKET_NAME = "import-bucket"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeHostReaderTest.java b/javatests/google/registry/rde/imports/RdeHostReaderTest.java index 080746624..cf25b8bcc 100644 --- a/javatests/google/registry/rde/imports/RdeHostReaderTest.java +++ b/javatests/google/registry/rde/imports/RdeHostReaderTest.java @@ -15,6 +15,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import com.google.appengine.tools.cloudstorage.GcsFilename; import com.google.appengine.tools.cloudstorage.GcsService; @@ -46,10 +47,10 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeHostReaderTest { - private static final ByteSource DEPOSIT_1_HOST = RdeImportsTestData.get("deposit_1_host.xml"); - private static final ByteSource DEPOSIT_3_HOST = RdeImportsTestData.get("deposit_3_host.xml"); - private static final ByteSource DEPOSIT_4_HOST = RdeImportsTestData.get("deposit_4_host.xml"); - private static final ByteSource DEPOSIT_10_HOST = RdeImportsTestData.get("deposit_10_host.xml"); + private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml"); + private static final ByteSource DEPOSIT_3_HOST = loadBytes("deposit_3_host.xml"); + private static final ByteSource DEPOSIT_4_HOST = loadBytes("deposit_4_host.xml"); + private static final ByteSource DEPOSIT_10_HOST = loadBytes("deposit_10_host.xml"); private static final String IMPORT_BUCKET_NAME = "rde-import"; private static final String IMPORT_FILE_NAME = "escrow-file.xml"; diff --git a/javatests/google/registry/rde/imports/RdeImportUtilsTest.java b/javatests/google/registry/rde/imports/RdeImportUtilsTest.java index f5014d366..00a89d213 100644 --- a/javatests/google/registry/rde/imports/RdeImportUtilsTest.java +++ b/javatests/google/registry/rde/imports/RdeImportUtilsTest.java @@ -67,13 +67,13 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeImportUtilsTest extends ShardableTestCase { - private static final ByteSource DEPOSIT_XML = RdeImportsTestData.get("deposit_full.xml"); + private static final ByteSource DEPOSIT_XML = RdeImportsTestData.loadBytes("deposit_full.xml"); private static final ByteSource DEPOSIT_BADTLD_XML = - RdeImportsTestData.get("deposit_full_badtld.xml"); + RdeImportsTestData.loadBytes("deposit_full_badtld.xml"); private static final ByteSource DEPOSIT_GETLD_XML = - RdeImportsTestData.get("deposit_full_getld.xml"); + RdeImportsTestData.loadBytes("deposit_full_getld.xml"); private static final ByteSource DEPOSIT_BADREGISTRAR_XML = - RdeImportsTestData.get("deposit_full_badregistrar.xml"); + RdeImportsTestData.loadBytes("deposit_full_badregistrar.xml"); private InputStream xmlInput; diff --git a/javatests/google/registry/rde/imports/RdeImportsTestData.java b/javatests/google/registry/rde/imports/RdeImportsTestData.java index dd609b3cf..65b6ca410 100644 --- a/javatests/google/registry/rde/imports/RdeImportsTestData.java +++ b/javatests/google/registry/rde/imports/RdeImportsTestData.java @@ -21,14 +21,14 @@ import google.registry.testing.TestDataHelper; public final class RdeImportsTestData { /** Returns {@link ByteSource} for file in {@code rde/imports/testdata/} directory. */ - public static ByteSource get(String filename) { + public static ByteSource loadBytes(String filename) { return TestDataHelper.loadBytes(RdeImportsTestData.class, filename); } /** * Loads data from file in {@code rde/imports/testdata/} as a String (assuming file is UTF-8). */ - public static String loadUtf8(String filename) { + public static String loadFile(String filename) { return TestDataHelper.loadFile(RdeImportsTestData.class, filename); } } diff --git a/javatests/google/registry/rde/imports/RdeParserTest.java b/javatests/google/registry/rde/imports/RdeParserTest.java index 679287656..580446031 100644 --- a/javatests/google/registry/rde/imports/RdeParserTest.java +++ b/javatests/google/registry/rde/imports/RdeParserTest.java @@ -15,6 +15,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import com.google.common.io.ByteSource; import google.registry.rde.imports.RdeParser.RdeHeader; @@ -40,7 +41,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RdeParserTest { - private static final ByteSource DEPOSIT_XML = RdeImportsTestData.get("deposit_full_parser.xml"); + private static final ByteSource DEPOSIT_XML = loadBytes("deposit_full_parser.xml"); private InputStream xml; diff --git a/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java b/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java index a0e647821..4323d9e8a 100644 --- a/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java +++ b/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java @@ -17,6 +17,7 @@ package google.registry.rde.imports; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.rde.imports.RdeImportTestUtils.checkTrid; +import static google.registry.rde.imports.RdeImportsTestData.loadBytes; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.getHistoryEntries; import static java.util.Arrays.asList; @@ -63,7 +64,7 @@ public class XjcToContactResourceConverterTest { "google.registry.xjc.rderegistrar", "google.registry.xjc.smd")); - private static final ByteSource CONTACT_XML = RdeImportsTestData.get("contact_fragment.xml"); + private static final ByteSource CONTACT_XML = loadBytes("contact_fragment.xml"); @Rule public final AppEngineRule appEngine = AppEngineRule.builder() diff --git a/javatests/google/registry/rde/imports/XjcToDomainResourceConverterTest.java b/javatests/google/registry/rde/imports/XjcToDomainResourceConverterTest.java index 3d8cea666..8a763736e 100644 --- a/javatests/google/registry/rde/imports/XjcToDomainResourceConverterTest.java +++ b/javatests/google/registry/rde/imports/XjcToDomainResourceConverterTest.java @@ -426,7 +426,7 @@ public class XjcToDomainResourceConverterTest { private XjcRdeDomain loadDomainFromRdeXml(String filename) { try { - ByteSource source = RdeImportsTestData.get(filename); + ByteSource source = RdeImportsTestData.loadBytes(filename); try (InputStream ins = source.openStream()) { return ((XjcRdeDomainElement) unmarshaller.unmarshal(ins)).getValue(); } diff --git a/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java b/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java index b688ee467..b99a0adc2 100644 --- a/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java +++ b/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java @@ -49,9 +49,9 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class XjcToHostResourceConverterTest extends ShardableTestCase { - private static final ByteSource HOST_XML = RdeImportsTestData.get("host_fragment.xml"); + private static final ByteSource HOST_XML = RdeImportsTestData.loadBytes("host_fragment.xml"); private static final ByteSource HOST_XML_UCASE = - RdeImportsTestData.get("host_fragment_ucase.xml"); + RdeImportsTestData.loadBytes("host_fragment_ucase.xml"); // List of packages to initialize JAXBContext private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":") diff --git a/javatests/google/registry/reporting/ActivityReportingQueryBuilderTest.java b/javatests/google/registry/reporting/ActivityReportingQueryBuilderTest.java index adad6597c..c6bc5c11a 100644 --- a/javatests/google/registry/reporting/ActivityReportingQueryBuilderTest.java +++ b/javatests/google/registry/reporting/ActivityReportingQueryBuilderTest.java @@ -61,7 +61,7 @@ public class ActivityReportingQueryBuilderTest { String actualTableName = String.format("%s_201709", queryName); String testFilename = String.format("%s_test.sql", queryName); assertThat(actualQueries.get(actualTableName)) - .isEqualTo(ReportingTestData.getString(testFilename)); + .isEqualTo(ReportingTestData.loadFile(testFilename)); } } diff --git a/javatests/google/registry/reporting/IcannHttpReporterTest.java b/javatests/google/registry/reporting/IcannHttpReporterTest.java index 01bf05ae8..a6edd4a33 100644 --- a/javatests/google/registry/reporting/IcannHttpReporterTest.java +++ b/javatests/google/registry/reporting/IcannHttpReporterTest.java @@ -45,8 +45,8 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class IcannHttpReporterTest { - private static final ByteSource IIRDEA_GOOD_XML = ReportingTestData.get("iirdea_good.xml"); - private static final ByteSource IIRDEA_BAD_XML = ReportingTestData.get("iirdea_bad.xml"); + private static final ByteSource IIRDEA_GOOD_XML = ReportingTestData.loadBytes("iirdea_good.xml"); + private static final ByteSource IIRDEA_BAD_XML = ReportingTestData.loadBytes("iirdea_bad.xml"); private static final byte[] FAKE_PAYLOAD = "test,csv\n1,2".getBytes(UTF_8); private MockLowLevelHttpRequest mockRequest; diff --git a/javatests/google/registry/reporting/ReportingTestData.java b/javatests/google/registry/reporting/ReportingTestData.java index c13582be9..cbada6c50 100644 --- a/javatests/google/registry/reporting/ReportingTestData.java +++ b/javatests/google/registry/reporting/ReportingTestData.java @@ -21,12 +21,12 @@ import google.registry.testing.TestDataHelper; public final class ReportingTestData { /** Returns {@link ByteSource} for file in {@code reporting/testdata/} directory. */ - public static ByteSource get(String filename) { + public static ByteSource loadBytes(String filename) { return TestDataHelper.loadBytes(ReportingTestData.class, filename); } /** Returns a {@link String} from a file in the {@code reporting/testdata/} directory. */ - public static String getString(String filename) { + public static String loadFile(String filename) { return TestDataHelper.loadFile(ReportingTestData.class, filename); } } diff --git a/javatests/google/registry/reporting/TransactionsReportingQueryBuilderTest.java b/javatests/google/registry/reporting/TransactionsReportingQueryBuilderTest.java index afdb080d9..5ddb8a01d 100644 --- a/javatests/google/registry/reporting/TransactionsReportingQueryBuilderTest.java +++ b/javatests/google/registry/reporting/TransactionsReportingQueryBuilderTest.java @@ -62,7 +62,7 @@ public class TransactionsReportingQueryBuilderTest { String actualTableName = String.format("%s_201709", queryName); String testFilename = String.format("%s_test.sql", queryName); assertThat(actualQueries.get(actualTableName)) - .isEqualTo(ReportingTestData.getString(testFilename)); + .isEqualTo(ReportingTestData.loadFile(testFilename)); } } } diff --git a/javatests/google/registry/testing/EppLoader.java b/javatests/google/registry/testing/EppLoader.java index 79a1748eb..8f6b3a07d 100644 --- a/javatests/google/registry/testing/EppLoader.java +++ b/javatests/google/registry/testing/EppLoader.java @@ -15,7 +15,7 @@ package google.registry.testing; import static google.registry.flows.EppXmlTransformer.unmarshal; -import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions; +import static google.registry.testing.TestDataHelper.loadFile; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableMap; @@ -33,7 +33,7 @@ public class EppLoader { } public EppLoader(Object context, String eppXmlFilename, Map substitutions) { - this.eppXml = loadFileWithSubstitutions(context.getClass(), eppXmlFilename, substitutions); + this.eppXml = loadFile(context.getClass(), eppXmlFilename, substitutions); } public EppInput getEpp() throws EppException { diff --git a/javatests/google/registry/testing/TestDataHelper.java b/javatests/google/registry/testing/TestDataHelper.java index ecfb2d166..061802fe3 100644 --- a/javatests/google/registry/testing/TestDataHelper.java +++ b/javatests/google/registry/testing/TestDataHelper.java @@ -55,7 +55,7 @@ public final class TestDataHelper { * Loads a text file from the "testdata" directory relative to the location of the specified * context class, and substitutes in values for placeholders of the form %tagname%. */ - public static String loadFileWithSubstitutions( + public static String loadFile( Class context, String filename, Map substitutions) { String fileContents = loadFile(context, filename); for (Entry entry : nullToEmpty(substitutions).entrySet()) { diff --git a/javatests/google/registry/tmch/TmchCertificateAuthorityTest.java b/javatests/google/registry/tmch/TmchCertificateAuthorityTest.java index 352d452d9..e464d938d 100644 --- a/javatests/google/registry/tmch/TmchCertificateAuthorityTest.java +++ b/javatests/google/registry/tmch/TmchCertificateAuthorityTest.java @@ -16,7 +16,7 @@ package google.registry.tmch; import static google.registry.config.RegistryConfig.ConfigModule.TmchCaMode.PILOT; import static google.registry.config.RegistryConfig.ConfigModule.TmchCaMode.PRODUCTION; -import static google.registry.tmch.TmchTestData.loadString; +import static google.registry.tmch.TmchTestData.loadFile; import static google.registry.util.ResourceUtils.readResourceUtf8; import static google.registry.util.X509Utils.loadCertificate; @@ -40,8 +40,8 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class TmchCertificateAuthorityTest { - public static final String GOOD_TEST_CERTIFICATE = loadString("icann-tmch-test-good.crt"); - public static final String REVOKED_TEST_CERTIFICATE = loadString("icann-tmch-test-revoked.crt"); + public static final String GOOD_TEST_CERTIFICATE = loadFile("icann-tmch-test-good.crt"); + public static final String REVOKED_TEST_CERTIFICATE = loadFile("icann-tmch-test-revoked.crt"); @Rule public final AppEngineRule appEngine = AppEngineRule.builder() diff --git a/javatests/google/registry/tmch/TmchTestData.java b/javatests/google/registry/tmch/TmchTestData.java index a59d6451e..097bf87ff 100644 --- a/javatests/google/registry/tmch/TmchTestData.java +++ b/javatests/google/registry/tmch/TmchTestData.java @@ -32,13 +32,13 @@ public final class TmchTestData { } /** Loads data from file in {@code tmch/testdata/} as a String. */ - public static String loadString(String filename) { + public static String loadFile(String filename) { return TestDataHelper.loadFile(TmchTestData.class, filename); } /** Extracts SMD XML from an ASCII-armored file. */ public static byte[] loadSmd(String file) { - String data = loadString(file); + String data = loadFile(file); return base64().decode(whitespace().removeFrom(data.substring( data.indexOf(BEGIN_ENCODED_SMD) + BEGIN_ENCODED_SMD.length(), data.indexOf(END_ENCODED_SMD)))); diff --git a/javatests/google/registry/tools/AllocateDomainCommandTest.java b/javatests/google/registry/tools/AllocateDomainCommandTest.java index a8d1bb0b2..65480b7b9 100644 --- a/javatests/google/registry/tools/AllocateDomainCommandTest.java +++ b/javatests/google/registry/tools/AllocateDomainCommandTest.java @@ -104,7 +104,7 @@ public class AllocateDomainCommandTest extends CommandTestCase { // The choice of xml file is arbitrary. runCommandForced( "--client=NewRegistrar", - ToolsTestData.loadUtf8("contact_create.xml")); + ToolsTestData.loadFile("contact_create.xml")); eppVerifier.verifySent("contact_create.xml"); } @@ -60,9 +60,9 @@ public class EppToolCommandTest extends EppToolCommandTestCase { // The choice of xml files is arbitrary. runCommandForced( "--client=NewRegistrar", - ToolsTestData.loadUtf8("contact_create.xml"), - ToolsTestData.loadUtf8("domain_check.xml"), - ToolsTestData.loadUtf8("domain_check_fee.xml")); + ToolsTestData.loadFile("contact_create.xml"), + ToolsTestData.loadFile("domain_check.xml"), + ToolsTestData.loadFile("domain_check_fee.xml")); eppVerifier .verifySent("contact_create.xml") .verifySent("domain_check.xml") diff --git a/javatests/google/registry/tools/EppToolVerifier.java b/javatests/google/registry/tools/EppToolVerifier.java index 4cd1c6893..96e153aa2 100644 --- a/javatests/google/registry/tools/EppToolVerifier.java +++ b/javatests/google/registry/tools/EppToolVerifier.java @@ -68,7 +68,7 @@ public class EppToolVerifier { /** * Sets the expected clientId for any following verifySent command. * - *

Must be called at least once before any {@link verifySent} calls. + *

Must be called at least once before any {@link #verifySent} calls. */ public EppToolVerifier expectClientId(String clientId) { this.clientId = clientId; @@ -78,7 +78,7 @@ public class EppToolVerifier { /** * Declares that any following verifySent command expects the "superuser" flag to be set. * - *

If not called, {@link verifySent} will expect the "superuser" flag to be false. + *

If not called, {@link #verifySent} will expect the "superuser" flag to be false. */ public EppToolVerifier expectSuperuser() { this.superuser = true; @@ -88,7 +88,7 @@ public class EppToolVerifier { /** * Declares that any following verifySent command expects the "dryRun" flag to be set. * - *

If not called, {@link verifySent} will expect the "dryRun" flag to be false. + *

If not called, {@link #verifySent} will expect the "dryRun" flag to be false. */ public EppToolVerifier expectDryRun() { this.dryRun = true; @@ -109,7 +109,7 @@ public class EppToolVerifier { * resides in the tools/server/testdata directory. */ public EppToolVerifier verifySent(String expectedXmlFile) throws Exception { - return verifySentContents(ToolsTestData.loadUtf8(expectedXmlFile)); + return verifySentContents(ToolsTestData.loadFile(expectedXmlFile)); } /** @@ -129,7 +129,7 @@ public class EppToolVerifier { */ public EppToolVerifier verifySent(String expectedXmlFile, Map substitutions) throws Exception { - return verifySentContents(ToolsTestData.loadUtf8(expectedXmlFile, substitutions)); + return verifySentContents(ToolsTestData.loadFile(expectedXmlFile, substitutions)); } /** diff --git a/javatests/google/registry/tools/ExecuteEppCommandTest.java b/javatests/google/registry/tools/ExecuteEppCommandTest.java index 3b5c59020..bcd91a6dd 100644 --- a/javatests/google/registry/tools/ExecuteEppCommandTest.java +++ b/javatests/google/registry/tools/ExecuteEppCommandTest.java @@ -35,7 +35,7 @@ public class ExecuteEppCommandTest extends EppToolCommandTestCase