SimpleJdbcOperations#query
takes an Object...
as the final parameter. The error occurs because this is not accounted for by a with
method, I think its because this compiles down to passing an empty array to this method which is not accounted for.
It works if you use,
allowing(jdbc).query(with(equal("SELECT Name FROM Customers")), with(any(RowMapper.class)), with(equal(new Object[0])));
will(returnValue(Arrays.asList("Bob")));