Rename ReturnValueStubber to When, so that you can do (When{File} <- MockFilePath).thenReturn(myfile);