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:
guyben 2018-04-05 13:01:59 -07:00 committed by Ben McIlwain
parent e5c0a85b3b
commit 6699915132
16 changed files with 70 additions and 78 deletions

View file

@ -15,7 +15,7 @@
package google.registry.tools;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.util.ResourceUtils.readResourceBytes;
import static google.registry.testing.TestDataHelper.loadBytes;
import com.google.common.io.ByteSource;
import com.google.common.io.Files;
@ -39,8 +39,7 @@ public class EncryptEscrowDepositCommandTest
@Rule
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
private final ByteSource depositXml =
readResourceBytes(RdeTestData.class, "testdata/deposit_full.xml");
private final ByteSource depositXml = loadBytes(RdeTestData.class, "deposit_full.xml");
static EscrowDepositEncryptor createEncryptor() {
EscrowDepositEncryptor res = new EscrowDepositEncryptor();