Assertions and exceptions are sent to the Error stream, so if you are looking to assert these you should also set the error stream:


System.setErr( new PrintStream(new ByteArrayOutputStream()));