[bs-62] Add assertions to CLI integration tests

[Fixes #48658503]
This commit is contained in:
Dave Syer
2013-04-26 08:22:30 +01:00
parent bcf86b320e
commit 61fa55b524
2 changed files with 49 additions and 19 deletions

View File

@@ -4,28 +4,22 @@ import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class SimpleBootstrapApplicationTests {
private static PrintStream savedOutput;
private static ByteArrayOutputStream output;
private PrintStream savedOutput;
private ByteArrayOutputStream output;
private String profiles;
@BeforeClass
public static void init() {
savedOutput = System.out;
output = new ByteArrayOutputStream();
System.setOut(new PrintStream(output));
}
@Before
public void before() {
public void init() {
this.savedOutput = System.out;
this.output = new ByteArrayOutputStream();
System.setOut(new PrintStream(this.output));
this.profiles = System.getProperty("spring.profiles.active");
}
@@ -36,15 +30,11 @@ public class SimpleBootstrapApplicationTests {
} else {
System.clearProperty("spring.profiles.active");
}
System.setOut(this.savedOutput);
}
@AfterClass
public static void clear() {
System.setOut(savedOutput);
}
private static String getOutput() {
return output.toString();
private String getOutput() {
return this.output.toString();
}
@Test