Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Problem with 1.9-SNAPSHOT and mockito
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jeppe Nejsum Madsen  
View profile  
 More options Mar 13 2012, 8:27 am
From: Jeppe Nejsum Madsen <je...@ingolfs.dk>
Date: Tue, 13 Mar 2012 13:27:48 +0100
Local: Tues, Mar 13 2012 8:27 am
Subject: Problem with 1.9-SNAPSHOT and mockito
Hi

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)

/Jeppe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
etorreborre  
View profile  
 More options Mar 13 2012, 5:58 pm
From: etorreborre <etorrebo...@gmail.com>
Date: Tue, 13 Mar 2012 14:58:32 -0700 (PDT)
Local: Tues, Mar 13 2012 5:58 pm
Subject: Re: Problem with 1.9-SNAPSHOT and mockito

That's a regression from my tentative to enable the mocking of implicitly
converted parameters.

Please try the latest 1.9-SNAPSHOT.

Thanks,

Eric.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeppe Nejsum Madsen  
View profile  
 More options Mar 14 2012, 11:40 am
From: Jeppe Nejsum Madsen <je...@ingolfs.dk>
Date: Wed, 14 Mar 2012 16:40:57 +0100
Local: Wed, Mar 14 2012 11:40 am
Subject: Re: Problem with 1.9-SNAPSHOT and mockito

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.

> Please try the latest 1.9-SNAPSHOT.

Works, thanks!

/Jeppe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »