1 * userService.isRegisteredForSite(domain,site) >> null
Then you say you also tried:
> 1 * sessionService.hasSessionExpired(_,_) >> null
Maybe you are just confusing things somewhere?
Is it important for your spec to verify that these methods get called, or do you just want the methods to return null? In the former case, you can remove the ">> null" part (which is the default). In the latter case, you can remove the whole interaction(s). Mocks will automatically return null/0/false for method calls they don't expect.
Cheers,
Peter
> So I am only concerned with ensuring the following :
> 1 * userService.isRegisteredForSite(domain,site) >> null
>
> I want to know that this is called correctly and the params are as
> expected. From what I can see this expectation should be fine.
>
> But I get 0 invocations.
Probably the expectation is wrong then. To see if some other invocation on userService was made, try:
0 * userService._
If you prefer strict validation, you can add this at the end of a then-block:
0 * _ // no other interactions allowed
Cheers,
Peter