Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Capturing interfaces fails because of parameter order #20
I have two interfaces and I am mocking one method on each one. I'm using the @Capturing annotation. But simply having the @Mocked parameters in a different order causes one of the interfaces to not be mocked.
(The same happens if the @Mocked parameters are fields of the test class - the order matters)
The code below has two identical tests. One fails only because the parameters are in a different order. (I believe that both tests should pass)
Yes, seems like there is a subtle bug here; I will look into it.
Two details in the example tests catch the attention, though; if you can clarify I would appreciate:
"Does the (real) test actually need to execute the real code of some methods, while others are mocked?"
"null is the default result for any method returning a reference type, so recording "result = null" for them is redundant. Or is there something I missed?"