@Test
public void listEnvironmentsWithPageable() {

     PageableDTO pageableDTO = new PageableDTO();
     pageableDTO.setLimit(10);
     pageableDTO.setOffset(0);
     ArrayList<Environment> environments = new ArrayList<>();
     environments.add(environment);
     Page<Environment> page = new PageImpl<>(environments);
     Mockito.when(this.environmentRepository
                            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class)))
            .thenReturn(page);
     EnvironmentPage environmentPageResp = this.environmentService
               .list(this.environmentDTO, pageableDTO);
     assertEquals(1L, environmentPageResp.getTotalElements());
     Mockito.verify(this.environmentRepository, Mockito.times(1))
            .findAll(Mockito.any(Example.class), Mockito.any(Pageable.class));
}