Java – Log messages to JUnit console


Sometimes as I'm writing unit tests it's useful to have log messages, and see them when I run the tests, in the JUnit console (I'm using IntelliJ, but I think Eclipse is very similar).

The problem is that System.out.println doesn't work. Does anyone have any tips on how to print log messages to the JUnit console?

Best Solution

You should select the test in the tree on the left to see its output in the console on the right:

enter image description here