I am trying to increase line coverage for my class in java. I am using Eclemma plugin for displaying line coverage. I have a situation like explained below:
Code:
public void someCall(){
boolean flag = false;
if(someService.anotherflag){
flag = true;
}else{
//some other things to do
}
if(!flag){
calleSomeMethod();
}
}
public static void calleSomeMethod(){
//do some thing here
}
test:
myService.someCall();
verify(myService,
Mockito.times(1)).calleSomeMethod();
But Jacoco still shows a red line in If block : calleSomeMethod();
Can anyone please suggest how to increase line coverage? I tried using verify but doesnt work. Any suggestions please? Any help is appreciated!!