📜  当方法返回 void 时模拟服务 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.048000             🧑  作者: Mango

代码示例1
doAnswer((i) -> {
    System.out.println("Employee setName Argument = " + i.getArgument(0));
    assertTrue("Pankaj".equals(i.getArgument(0)));
    return null;
}).when(emp).setName(anyString());