java - Mockito: Why does this verify with ArgumentCaptor not match? -


i working on tests project here @ company. used mockito.verify(...) in combination argumentcaptor quite bit know bit puzzeled, because in case following test code not work out expected:

@mock buildhandler buildhandler; ... argumentcaptor<build> savedbuildcaptor = argumentcaptor.forclass(build.class); verify(buildhandler, times(1)).save(savedbuildcaptor.capture()); ... 

i expected savedbuildcaptor catch me build object passed buildhandler.save(build b) method. in fact during execution end test failure mockito:

argument(s) different! wanted: buildhandler.save(null); actual invocation has different arguments: buildhandler.save(1234); 

can point me (might have) screwed up?

if additional code/info required i'll post it.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -