how to mock a method that returns void code example
Example: mock a service when the method returning void
doAnswer((i) -> {
System.out.println("Employee setName Argument = " + i.getArgument(0));
assertTrue("Pankaj".equals(i.getArgument(0)));
return null;
}).when(emp).setName(anyString());