Jacoco(Eclemma) plugin not showing line coverage e

2019-08-17 16:59发布

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!!

0条回答
登录 后发表回答