mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Do not use InjectRule to mock stdin in ExecuteEppCommandTest
Use System.setIn() to do the same thing. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=217595385
This commit is contained in:
parent
4140ef6315
commit
f174ec6cd4
2 changed files with 2 additions and 14 deletions
|
@ -18,19 +18,14 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
|||
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;
|
||||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link ExecuteEppCommand}. */
|
||||
public class ExecuteEppCommandTest extends EppToolCommandTestCase<ExecuteEppCommand> {
|
||||
|
||||
@Rule
|
||||
public InjectRule inject = new InjectRule();
|
||||
|
||||
private String xmlInput;
|
||||
private String eppFile;
|
||||
|
||||
|
@ -60,8 +55,7 @@ public class ExecuteEppCommandTest extends EppToolCommandTestCase<ExecuteEppComm
|
|||
|
||||
@Test
|
||||
public void testSuccess_fromStdin() throws Exception {
|
||||
inject.setStaticField(
|
||||
ExecuteEppCommand.class, "stdin", new ByteArrayInputStream(xmlInput.getBytes(UTF_8)));
|
||||
System.setIn(new ByteArrayInputStream(xmlInput.getBytes(UTF_8)));
|
||||
runCommand("--client=NewRegistrar", "--force");
|
||||
eppVerifier.verifySent("contact_create.xml");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue