@Test
public void listTest() {

    ScopeDTO scopeDTO = new ScopeDTO();
    scopeDTO.setName("Scope");
    scopeDTO.setDescription("Scope description");
    List<Scope> scopesExpected = new ArrayList<>();
    scopesExpected.add(scope);
    Mockito.when(apiService.find(Mockito.anyLong())).thenReturn(scope.getApi());
    Mockito.when(scopeRepository.findAll(Mockito.any(Example.class))).thenReturn(scopesExpected);
    List<Scope> listScopes = scopeService.list(scope.getApi().getId(), scopeDTO);
    assertEquals(scopesExpected, listScopes);
}