0
  public void SomeClass {
       public void process() {
       mylist.addAll(rpp.getFilePaths(id));
       }
  }


    public class Test {

    @Test
        public void testProcess() throws Exception {  
         // I need help here ... 
        List <Path> results = when(rpp.getFilePaths(id)).thenReturn)(blah blah);
        test.process();
    }

}

With Mockito, how can I obtain the values of mylist when test.process() is called or how can I obtain the List that was returned when rpp.getFilePaths(id) was called.

M06H
  • 1,675
  • 3
  • 36
  • 76
  • 1
    Similar and answered http://stackoverflow.com/questions/2276271/how-to-make-mock-to-void-methods-with-mockito – whitecoffee Aug 26 '15 at 17:03

1 Answers1

0

I would do something like this

List<Path> results = new ....;
doReturn(results).when(rpp).getFilePaths(id);