• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mockito, testing org.hibernate.ScrollableResults count of 1000

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be done in the following way

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic