mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 16:30:12 +02:00
Fix command tests that set stdout/stderr (#258)
* Fix command tests that set stdout/stderr CommandTestCase already wraps stdout stderr, just use the provided methods.
This commit is contained in:
parent
729b69550e
commit
c5e4e862bd
2 changed files with 2 additions and 12 deletions
|
@ -34,8 +34,6 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.Range;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.registry.Registry;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -472,14 +470,11 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testSuccess_setCommonAndReservedListFromOtherTld_withOverride() throws Exception {
|
||||
ByteArrayOutputStream errContent = new ByteArrayOutputStream();
|
||||
System.setErr(new PrintStream(errContent));
|
||||
runReservedListsTestOverride("common_abuse,tld_banned");
|
||||
String errMsg =
|
||||
"Error overridden: The reserved list(s) tld_banned "
|
||||
+ "cannot be applied to the tld xn--q9jyb4c";
|
||||
assertThat(errContent.toString()).contains(errMsg);
|
||||
System.setOut(null);
|
||||
assertThat(getStderrAsString()).contains(errMsg);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -38,8 +38,6 @@ import com.google.common.collect.ImmutableSortedMap;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Duration;
|
||||
|
@ -898,14 +896,11 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testSuccess_setCommonAndReservedListFromOtherTld_withOverride() throws Exception {
|
||||
ByteArrayOutputStream errContent = new ByteArrayOutputStream();
|
||||
System.setErr(new PrintStream(errContent));
|
||||
runReservedListsTestOverride("common_abuse,tld_banned");
|
||||
String errMsg =
|
||||
"Error overridden: The reserved list(s) tld_banned "
|
||||
+ "cannot be applied to the tld xn--q9jyb4c";
|
||||
assertThat(errContent.toString()).contains(errMsg);
|
||||
System.setOut(null);
|
||||
assertThat(getStderrAsString()).contains(errMsg);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue