#610
[JUnit] Test System.err and System.out content
public class TestClass { @Rule public final StandardErrorStreamLog logErr = new StandardErrorStreamLog(); @Rule public final StandardOutputStreamLog log = new StandardOutputStreamLog(); @Test public void test1() { System.err.print("hello world"); assertEquals("hello world", logErr.getLog()); } }
Maven dependency :
<dependency> <groupId>com.github.stefanbirkner</groupId> <artifactId>system-rules</artifactId> <version>1.5.0</version> </dependency>
[JUnit] Test System.exit value [JUnit] Combined Parametrized Test and Autowiring (Spring)
Comments are currently closed.