After upgrading from 1.8.2 to 1.9-SNAPSHOT, it seems mockito verification no longer works.
"delete records before saving, when there is no matching id" in new TestNodes { val daoMock = mock[OrgUnitDAO] daoMock.get(999) returns Full(rootOU) daoMock.create("newnode", "999") returns ou42 daoMock.create("newchild", "999.42") returns ou44 service(daoMock).saveAll(account, CompanyNode(999, "root", List(CompanyNode(0, "newnode", List(child2.copy(children = List(child3.copy())), CompanyNode(0, "newchild"))), child5)))
there were one(daoMock).deleteAllExcept_!(rootOU, 2, 999,2,3,5) then 4.times(daoMock).update(anyLong, anyString, anyString) }
This example fails with 1.8.2 but succeeds with 1.9-SNAPSHOT.
The (correct) error I see in 1.8.2 is:
java.lang.Exception: The mock was not called as expected: Argument(s) are different! Wanted: orgUnitDAO.deleteAllExcept_$bang( OrgUnit(,), WrappedArray(2, 999, 2, 3, 5) ); -> at fleetzone.unittest.service.CompanyStructureSpec$$anonfun$39$$anonfun$apply$ 36$$anon$16$$anonfun$61$$anonfun$apply$3.apply$mcV$sp(CompanyStructureSpec. scala:202) Actual invocation has different arguments: orgUnitDAO.deleteAllExcept_$bang( OrgUnit(,), List(999, 2, 3, 5) ); -> at fleetzone.service.CompanyStructureService$$anonfun$saveAll$1.apply(CompanyS tructureService.scala:283)
On Tue, Mar 13, 2012 at 10:58 PM, etorreborre <etorrebo...@gmail.com> wrote: > That's a regression from my tentative to enable the mocking of implicitly > converted parameters.