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
Post a Comment