title: Code coverage for service class method
body: <p>I'm trying to do the code coverage for a method of service class with mockito. I'm new with mockito and tried to mock the call to service method but the code coverage is 0. I'm not sure if I can mock call or can I for this particular method. If you have any suggestions please let me know.
  Code:</p>
  
  <pre><code>public List&lt;Something&gt; getTrackerData(String startDay,List&lt;Something&gt; someList,  boolean check,String name)
  {
  //filled with many if else checks
  }
  </code></pre>
  
  <p>This is the method i want to do coverage for.</p>
  
  <p>@InjectMocks
      private TrackerService trackerService;</p>
  
  <pre><code>@Before
  public void setup(){
      MockitoAnnotations.initMocks(this);
  }
  
  @Test
      public void test01()
      {
          Something ttd =new Something();
          ttd.setCoverageSubType("None");
          ttd.setCoveredAmount("1.0");
          List&lt;Something&gt; list = new ArrayList&lt;&gt;();
          list.add(ttd);
  
          List&lt;Something &gt; newlist = mock(List.class);
  //      when(trackerService.getTrackerData("", newlist, false, "")).
  //      thenReturn(list);
  
          resultList = trackerService.getTrackerData(anyString(), anyList(), anyBoolean(), anyString());
  
      }
  </code></pre>
  
  <p>This is the test i have written. I realize that when and Mockito.verify() works only on mocked dependencies. But here I don't have any dependency to mock. So, the question is can I mock the call to <code>trackerService.getTrackerData()</code> with Mockito stub parameters or I have to test the method with actual parameters only ? </p>