mirror of
https://github.com/google/nomulus
synced 2026-09-01 05:37:08 +00:00
Move tests to use TestDataHelper for reading resources
TestDataHelper is build exactly to prevent direct reads of resources. It caches the resources and makes sure they are in the correct directory. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191785004
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
package google.registry.tools;
|
||||
|
||||
import static google.registry.request.JsonResponse.JSON_SAFETY_PREFIX;
|
||||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import static google.registry.testing.TestDataHelper.loadFile;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyMapOf;
|
||||
import static org.mockito.Matchers.eq;
|
||||
@@ -44,11 +44,10 @@ public class UpdatePremiumListCommandTest<C extends UpdatePremiumListCommand>
|
||||
public void init() throws Exception {
|
||||
command.setConnection(connection);
|
||||
servletPath = "/_dr/admin/updatePremiumList";
|
||||
premiumTermsPath = writeToNamedTmpFile(
|
||||
"example_premium_terms.csv",
|
||||
readResourceUtf8(
|
||||
UpdatePremiumListCommandTest.class,
|
||||
"testdata/example_premium_terms.csv"));
|
||||
premiumTermsPath =
|
||||
writeToNamedTmpFile(
|
||||
"example_premium_terms.csv",
|
||||
loadFile(UpdatePremiumListCommandTest.class, "example_premium_terms.csv"));
|
||||
when(connection.send(
|
||||
eq(UpdatePremiumListAction.PATH),
|
||||
anyMapOf(String.class, String.class),
|
||||
|
||||
Reference in New Issue
Block a user