I am trying to increase the line coverage for my code. I am calling a static method from a non static method. As part of unit test i am trying to cover the test case for below code:
My code:
1 public void myMethod(){
2 something else;
3 testMethod();
4 }
5 public static void testMethod(){
6 //do something;
7 }
My test code:
8 myService.myMethod();
From above i can see the jacocco coverage missing(Red) for line # 3 but line number 6 shows as covered(green). How can i increase the line coverage in this case by making line #3 covered. Any help/suggestions are appreciated.