mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 19:29:35 +02:00
Add gTech command to get .app domain info
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127582475
This commit is contained in:
parent
b9d1a4362f
commit
d9596fa30c
2 changed files with 13 additions and 2 deletions
|
@ -49,7 +49,8 @@ import org.mockito.runners.MockitoJUnitRunner;
|
|||
@RunWith(MockitoJUnitRunner.class)
|
||||
public abstract class CommandTestCase<C extends Command> {
|
||||
|
||||
private ByteArrayOutputStream stdout = new ByteArrayOutputStream();
|
||||
private final ByteArrayOutputStream stdout = new ByteArrayOutputStream();
|
||||
private final ByteArrayOutputStream stderr = new ByteArrayOutputStream();
|
||||
|
||||
protected C command;
|
||||
|
||||
|
@ -71,6 +72,7 @@ public abstract class CommandTestCase<C extends Command> {
|
|||
RegistryToolEnvironment.UNITTEST.setup();
|
||||
command = newCommandInstance();
|
||||
System.setOut(new PrintStream(stdout));
|
||||
System.setErr(new PrintStream(stderr));
|
||||
}
|
||||
|
||||
void runCommandInEnvironment(RegistryToolEnvironment env, String... args) throws Exception {
|
||||
|
@ -156,6 +158,13 @@ public abstract class CommandTestCase<C extends Command> {
|
|||
}
|
||||
}
|
||||
|
||||
protected void assertInStderr(String... expected) throws Exception {
|
||||
String stderror = new String(stderr.toByteArray(), UTF_8);
|
||||
for (String line : expected) {
|
||||
assertThat(stderror).contains(line);
|
||||
}
|
||||
}
|
||||
|
||||
void assertNotInStdout(String expected) throws Exception {
|
||||
assertThat(getStdoutAsString()).doesNotContain(expected);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue