I am running unit tests using maven. At one point I need to pause execution in order for the tester to do something. Once they have done it, they need to press a key. I have the following code in my unit test.
try {
while (true) {
System.out.print("Enter something : ");
inputResult = System.console().readLine();
}
} catch (Exception exc) {
// exception handling code to
// print out message and stack trace
}
When this code is run, an exception is caught which has a stack trace leading to the line:
inputResult = System.console().readLine();
Why would this be happening? And how might I solve it?