The following code works nicely when running the code through a main in Idea
System.in.read()
However the same code inside a junit method is no
You need to start the IDE with -Deditable.java.test.console=true (e.g. via "Help" > "Edit Custom VM Options..."), see this comment.
-Deditable.java.test.console=true