I have one void method. I am trying to write a test method for this.
The test is getting passed. But its not getting covered with the eclemma.
Test Method -
@Test
public void testSetName() {
Mockito.doAnswer((i) -> {
Assert.assertEquals("123", i.getArgument(0));
return null;
}).when(policyServiceImpl1).setName("123");
}
Actual Method -
public void setName(String val) {
this.name = val;
}
What am I doing wrong?
Regards,
Amit Sahoo