idea中无法在@Test 之下使用Scanner

//如何解决idea中无法在 @Test 之下使用Scanner
@Test
public void testInsert(){
Scanner scanner = new Scanner(System.in);
System.out.println("输入用户名:");
String name=scanner.next();
System.out.println("输入邮箱:");
String email=scanner.next();
在修改之前运行之后无法输入,卡在scanner之中
方法一


 



在文件中添加:-Deditable.java.test.console=true




方法二
:重新编写在main方法下运行
posted @ 2022-08-09 18:14  不如赐场梦给我  阅读(178)  评论(0)    收藏  举报