mardi 3 novembre 2015

is there any way to have a test/mock a File input using junit?

I am trying to test the following code without using a real xls file...

File file = new File("file.xls");
final FileInputStream input = new FileInputStream(file);

My problem is that I cannot create an instance of File, and I dont know how to simulate I am creating a new file and how to mock what to expect.

Is there any way to do this using junit?

Thanks

Aucun commentaire:

Enregistrer un commentaire