Refactor RdeKeyringModule into FakeKeyringModule

A fake Keyring implementation is needed to test Keyring related tools now, so
I've refactored the fake RdeKeyring to support all Keyring API methods and
moved it to the common testing package.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149977968
This commit is contained in:
shikhman 2017-03-13 12:55:51 -07:00 committed by Ben McIlwain
parent 2353bcd8c5
commit 5779cc988b
15 changed files with 281 additions and 47 deletions

View file

@ -20,8 +20,8 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import google.registry.keyring.api.Keyring;
import google.registry.rde.Ghostryde;
import google.registry.rde.Ghostryde.DecodeResult;
import google.registry.rde.RdeKeyringModule;
import google.registry.testing.BouncyCastleProviderRule;
import google.registry.testing.FakeKeyringModule;
import google.registry.testing.InjectRule;
import java.nio.file.Files;
import java.nio.file.Path;
@ -65,7 +65,7 @@ public class GhostrydeCommandTest extends CommandTestCase<GhostrydeCommand> {
@Before
public void before() throws Exception {
keyring = new RdeKeyringModule().get();
keyring = new FakeKeyringModule().get();
command.ghostryde = new Ghostryde(1024);
command.rdeStagingDecryptionKey = keyring.getRdeStagingDecryptionKey();
command.rdeStagingEncryptionKey = keyring.getRdeStagingEncryptionKey();