My SUT may call a method on my mock with any object as paramter, including null.
So, does EasyMock.anyObject() match a null parameter? or can I use something else instead of anyObject() which will also match null ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since EasyMock also offers matchers for
notNull()andnull(), I assume the answer is yes – otherwiseanyObject()andnotNull()would be redundant (ifanyObject()did not match null).A simple test confirms this.