How would you test Scanner input in Java?

So I am new to Replit. I am trying to make a test that test input from the keyboard and then a final print statement. However, my test keeps getting stuck at the first Print statement I ask. Even though my output is correct. Just curious on how to go about testing Scanner input?

So like:

System.out.println("What is your name?");
String name = input.nextLine();

How do I get it to recognize both the statement and the return?

Any help is appreciated. Thanks in advance!

You are viewing a single comment. View All

@Tanisi90 hmm... not sure I know what you mean. Is it that you don't want duplicate names?