KARR, DAVID
unread,Sep 27, 2012, 7:42:06 PM9/27/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to moc...@googlegroups.com
I have a test that is using "verify()" where one of the parameters to the verified method is an ArgumentCaptor. The verified method also has two other parameters that I'm using "any..." expressions to match.
When I run the test, it's saying "Arguments are different".
This is essentially the error message, with much elided:
----------------
Argument(s) are different! Wanted:
jdbcTemplate.query(
<Capturing argument>,
<any>,
<any>
);
-> at ...Test.testGetMergedResults(...Test.java:49)
Actual invocation has different arguments:
jdbcTemplate.query(
PreparedStatementCreatorFactory.PreparedStatementCreatorImpl: sql=[select ... ]; parameters=[abc, def, abc, def, abc, def, abc, def, abc, def, abc, def],
...RowMapper@dac21
);
----------------
From the test method:
ArgumentCaptor<String> queryCaptor = ArgumentCaptor.forClass(String.class);
verify(jdbcTemplate).query(queryCaptor.capture(), any(...RowMapper.class), anyMap());
I'm not sure what I'm seeing here.