mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02: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:
parent
e5c0a85b3b
commit
6699915132
16 changed files with 70 additions and 78 deletions
|
@ -15,7 +15,7 @@
|
|||
package google.registry.tools;
|
||||
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import static google.registry.testing.TestDataHelper.loadFile;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
|
@ -40,8 +40,8 @@ public abstract class CreateOrUpdateReservedListCommandTestCase
|
|||
public void init() throws IOException {
|
||||
File reservedTermsFile = tmpDir.newFile("xn--q9jyb4c_common-reserved.txt");
|
||||
File invalidReservedTermsFile = tmpDir.newFile("reserved-terms-wontparse.csv");
|
||||
String reservedTermsCsv = readResourceUtf8(
|
||||
CreateOrUpdateReservedListCommandTestCase.class, "testdata/example_reserved_terms.csv");
|
||||
String reservedTermsCsv =
|
||||
loadFile(CreateOrUpdateReservedListCommandTestCase.class, "example_reserved_terms.csv");
|
||||
Files.asCharSink(reservedTermsFile, UTF_8).write(reservedTermsCsv);
|
||||
Files.asCharSink(invalidReservedTermsFile, UTF_8)
|
||||
.write("sdfgagmsdgs,sdfgsd\nasdf234tafgs,asdfaw\n\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue