why my test case for void methods are not covered in EclEmma

21 views
Skip to first unread message

kumaram...@gmail.com

unread,
May 29, 2019, 11:46:18 AM5/29/19
to JaCoCo and EclEmma Users
Hi,

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

Evgeny Mandrikov

unread,
May 29, 2019, 11:58:59 AM5/29/19
to JaCoCo and EclEmma Users
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages