added a comment -
08/Nov/09 11:46 AM There was a problem with the chaining mechanism
The problem occurs when an assert is performed on a method has a return value:
For example:
public List<String> list(int value);
sampleService.assertInvoked().list(100);
sampleService.assertInvoked().list(100);
the second assertion will give the syntax error.
The reason for this is that unitils automatically creates a mock list instance and replaces the assertion with:
sampleService.assertInvoked().list(100).assertInvoked();
This makes it possible to do something like (i.e. method chaining):
sampleService.assertInvoked().list(100).iterator();
I've fixed the issue so that this no longer causes a syntax error.
Thanks for the report, I'll release a new version with the fix as soon as possible.
Grtz,
Tim