diff --git a/javatests/google/registry/tools/AllocateDomainCommandTest.java b/javatests/google/registry/tools/AllocateDomainCommandTest.java index 41a73ac87..5b06af429 100644 --- a/javatests/google/registry/tools/AllocateDomainCommandTest.java +++ b/javatests/google/registry/tools/AllocateDomainCommandTest.java @@ -15,8 +15,6 @@ package google.registry.tools; import static com.google.common.io.BaseEncoding.base16; -import static com.google.common.io.Resources.getResource; -import static com.google.common.io.Resources.toByteArray; import static com.google.common.truth.Truth.assertThat; import static google.registry.flows.EppXmlTransformer.unmarshal; import static google.registry.flows.picker.FlowPicker.getFlowClass; @@ -31,7 +29,6 @@ import static google.registry.testing.DatastoreHelper.persistActiveContact; import static google.registry.testing.DatastoreHelper.persistActiveHost; import static google.registry.testing.DatastoreHelper.persistResource; import static google.registry.util.DateTimeUtils.START_OF_TIME; -import static google.registry.util.ResourceUtils.readResourceBytes; import com.beust.jcommander.ParameterException; import com.google.common.collect.ImmutableSet; @@ -45,6 +42,7 @@ import google.registry.model.eppcommon.Trid; import google.registry.model.eppinput.EppInput; import google.registry.model.reporting.HistoryEntry; import google.registry.tools.ServerSideCommand.Connection; +import google.registry.tools.server.ToolsTestData; import java.io.IOException; import org.joda.time.DateTime; import org.junit.Before; @@ -61,8 +59,8 @@ public class AllocateDomainCommandTest extends CommandTestCase { // The choice of xml file is arbitrary. runCommandForced( "--client=NewRegistrar", - readResourceUtf8(getClass(), "testdata/contact_create.xml")); + ToolsTestData.loadUtf8("contact_create.xml")); eppVerifier().verifySent("contact_create.xml"); } @@ -61,9 +60,9 @@ public class EppToolCommandTest extends EppToolCommandTestCase { // The choice of xml files is arbitrary. runCommandForced( "--client=NewRegistrar", - readResourceUtf8(getClass(), "testdata/contact_create.xml"), - readResourceUtf8(getClass(), "testdata/domain_check.xml"), - readResourceUtf8(getClass(), "testdata/domain_check_fee.xml")); + ToolsTestData.loadUtf8("contact_create.xml"), + ToolsTestData.loadUtf8("domain_check.xml"), + ToolsTestData.loadUtf8("domain_check_fee.xml")); eppVerifier().verifySent("contact_create.xml", "domain_check.xml", "domain_check_fee.xml"); } diff --git a/javatests/google/registry/tools/EppToolVerifier.java b/javatests/google/registry/tools/EppToolVerifier.java index 63c76746b..bd17335ed 100644 --- a/javatests/google/registry/tools/EppToolVerifier.java +++ b/javatests/google/registry/tools/EppToolVerifier.java @@ -15,7 +15,6 @@ package google.registry.tools; import static com.google.common.truth.Truth.assertThat; -import static google.registry.util.ResourceUtils.readResourceUtf8; import static google.registry.xml.XmlTestUtils.assertXmlEquals; import static java.nio.charset.StandardCharsets.UTF_8; import static org.mockito.Matchers.eq; @@ -26,6 +25,7 @@ import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; import com.google.common.net.MediaType; import google.registry.tools.ServerSideCommand.Connection; +import google.registry.tools.server.ToolsTestData; import java.net.URLDecoder; import java.util.List; import java.util.Map; @@ -85,7 +85,7 @@ public class EppToolVerifier { .split(new String(capturedParam, UTF_8)); assertThat(map).hasSize(4); assertXmlEquals( - readResourceUtf8(getClass(), "testdata/" + xml), + ToolsTestData.loadUtf8(xml), URLDecoder.decode(map.get("xml"), UTF_8.toString())); assertThat(map).containsEntry("dryRun", Boolean.toString(dryRun)); assertThat(map).containsEntry("clientId", clientId); diff --git a/javatests/google/registry/tools/ExecuteEppCommandTest.java b/javatests/google/registry/tools/ExecuteEppCommandTest.java index 5b515d9ca..e573b226e 100644 --- a/javatests/google/registry/tools/ExecuteEppCommandTest.java +++ b/javatests/google/registry/tools/ExecuteEppCommandTest.java @@ -14,11 +14,11 @@ package google.registry.tools; -import static google.registry.util.ResourceUtils.readResourceUtf8; import static java.nio.charset.StandardCharsets.UTF_8; import com.beust.jcommander.ParameterException; import google.registry.testing.InjectRule; +import google.registry.tools.server.ToolsTestData; import java.io.ByteArrayInputStream; import org.junit.Before; import org.junit.Rule; @@ -35,7 +35,7 @@ public class ExecuteEppCommandTest extends EppToolCommandTestCase