Reading System.in from the Console using Intellij and JUnit

后端 未结 2 1269
说谎
说谎 2021-01-23 10:24

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

2条回答
  •  一整个雨季
    2021-01-23 10:58

    You need to start the IDE with -Deditable.java.test.console=true (e.g. via "Help" > "Edit Custom VM Options..."), see this comment.

提交回复
热议问题