"new" );
}
@Test
public void testLoadRuleListForCategories() throws SerializationException {
CategoryPageRequest categoryPageRequest = new CategoryPageRequest( "/path",
0,
new Integer( 10 ) );
RangeIterator rangeIterator = mock( RangeIterator.class );
when( rangeIterator.hasNext() ).thenReturn( false );
when( rangeIterator.getPosition() ).thenReturn( 1L );
AssetItemPageResult assetItemPageResult = new AssetItemPageResult( Arrays.asList( mock( AssetItem.class,
Mockito.RETURNS_MOCKS ) ),
1, false );
when( rulesRepository.findAssetsByCategory( categoryPageRequest.getCategoryPath(),
false,
categoryPageRequest.getStartRowIndex(),
10 ) ).thenReturn( assetItemPageResult );
PageResponse<CategoryPageRow> loadRuleListForCategories = repositoryCategoryOperations.loadRuleListForCategories( categoryPageRequest );
assertNotNull( loadRuleListForCategories );
assertEquals( loadRuleListForCategories.getStartRowIndex(),
categoryPageRequest.getStartRowIndex() );
assertNotNull( loadRuleListForCategories.getPageRowList() );
assertEquals( loadRuleListForCategories.getPageRowList().size(),
1 );
assertEquals( loadRuleListForCategories.isLastPage(),
true );