I would like verify() to silently accept a null pointer. It would remove a lot of boilerplate code in my unit tests.
verify(null) doesn't throw
verify(null) throws NullPointerException
Can you give me a use-case? I'm quite surprised that a null mock can be passed to EasyMock since the mock comes from the test.
I'm trying to keep my tests as short and sharp as possible, so I moved mock-up validation to the tear-down method; @AfterMethod using TestNG. I write a test like thus:
public void verifyMockups()
public void shouldGetAccount()
Account account = myCache.getAccount(ACCOUNT_ID);
If I add a test which doesn't use a provider, myProvider will be null, and the verification will fail, unless I add boilerplate code to check for null before validating.
I would like to avoid the boilerplate code.
Log in to post a comment.