java - EasyMock 'Expected 1, Actual 1' -


i'm having problem unit test using easymock.

expectation failure on verify:      fileconverter.convert(file, file2): expected: 1, actual: 1 

this failure in class , fails on verify method below. have tried google message, brings results "expected: 1, actual: 1 (+1)", , +1 implies error different.

i have tried simplify structure of failing easymock test demonstration. please forgive typos:

@test public void testscan() {   string[] testfiles = { "file", "file2" };   fileconverter convertermock = easymock.createmock(fileconverter.class);   poller poller = new poller(new file("testfolder"), convertermock);    (string testfile : testfiles) {     convertermock.convert(new file(testfile));     easymock.expectlastcall().once();   }   easymock.replay(convertermock);    (string testfile : testfiles) {     poller.scan();   }   easymock.verify(convertermock); } 

i don't think code particularly relevant have included completeness - looking explanation of "expected 1, actual 1" mean in context of easymock.verify method.

thanks in advance!

another optional case when using multithreaded environment, might occur desired method has invoked on mock object after test has ended.


Comments