@Test
public void listResourcesWithPageable() {

     PageableDTO pageableDTO = new PageableDTO();
     pageableDTO.setLimit(10);
     pageableDTO.setOffset(0);
     ArrayList<Resource> listResources = new ArrayList<>();
     this.resource.setName("Resource Name");
     listResources.add(resource);
     Page<Resource> page = new PageImpl<>(listResources);
     Mockito.when(apiRepository.findOne(Mockito.anyLong())).thenReturn(api);
     Mockito.when(this.resourceRepository
                            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class)))
            .thenReturn(page);
     ResourcePage resourcePageResp = this.resourceService.list(1L, this.resourceDTO, pageableDTO);
     assertEquals(1L, resourcePageResp.getTotalElements());
     Mockito.verify(this.resourceRepository, Mockito.times(1))
            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class));
}