I am unit-testing a method performing some serialization operations. I intend to mock the serialization logic. The code is as below:
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)));
I have created the following mock objects:
@Mocked FileInputStream mockFIS;
@Mocked BufferedInputStream mockBIS;
@Mocked ObjectInputStream mockOIS;
I have setup a NonStrictExpectations()
block where I want to expect the above constructor calls.
Any ideas on how I can achieve this?