@Test
public void listOperationsWithPageable() {

     PageableDTO pageableDTO = new PageableDTO();
     pageableDTO.setLimit(10);
     pageableDTO.setOffset(0);
     ArrayList<Operation> listOperations = new ArrayList<>();
     listOperations.add(operation);
     Page<Operation> page = new PageImpl<>(listOperations);
     Mockito.when(resourceRepository.findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong()))
            .thenReturn(res);
     Mockito.when(this.operationRepository
                            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class)))
            .thenReturn(page);
     OperationPage operationPageResp = this.operationService
               .list(1L, 1L, this.operationDTO, pageableDTO);
     assertEquals(1L, operationPageResp.getTotalElements());
     Mockito.verify(this.operationRepository, Mockito.times(1))
            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class));
}