Meaningless Drivel is fun!*
The moose likes Testing and the fly likes Mockito Help - Problem to sort a List of mock objects. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mockito Help - Problem to sort a List of mock objects." Watch "Mockito Help - Problem to sort a List of mock objects." New topic
Author

Mockito Help - Problem to sort a List of mock objects.

robson vargas
Greenhorn

Joined: Jun 10, 2008
Posts: 15
Hi ranchers.

Im using mockito to build some unit tests, as the fallow code can show:



This tests work fine. But.. look the little change:



Then i got a big NullPointerException into my compare method, in the moment that the "getState" is invoked. (o1.checkAt(States.NONE).getState() )

So i ask you, why the "getState" work if its on the test scope but fail if its on the comparator scope ?


Thanks in adv.



scjp ~ 83%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mockito Help - Problem to sort a List of mock objects.
 
Similar Threads
another question about using comparator
determine the input type of the value of the function parameter map
Sorting Collection
ArrayList sorting using Ccomparator
Please help me to understand why i am getting an empty map and how can i fix it