*
The moose likes Testing and the fly likes Mockito, testing org.hibernate.ScrollableResults count of 1000 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mockito, testing org.hibernate.ScrollableResults count of 1000" Watch "Mockito, testing org.hibernate.ScrollableResults count of 1000" New topic
Author

Mockito, testing org.hibernate.ScrollableResults count of 1000

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Hi, Using Mockito I want to test the condition where I get to a count of 1000 in org.hibernate.ScrollableResults, One way to do this would be to have when(scrollableResults.next()).thenReturn(true).thenReturn(true).thenReturn(true).....................................; more than thousand times. Is there a shorter way of doing this? Please let me know if you need more information.



Thanks,
Santosh
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
It can be done in the following way

 
 
subject: Mockito, testing org.hibernate.ScrollableResults count of 1000
 
Similar Threads
Mockito "when" problem
stubbing methods that throw a checked exception using Mockito
Mockito Help - Problem to sort a List of mock objects.
Button Recording to a File
Casting Arrays