Skip to content

Commit

Permalink
ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed May 7, 2021
1 parent 1064e1b commit 2096774
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ public void convertToCollectionTest() {
convertedCollectionKey, getClient().convertToCollection(UUID.randomUUID(), params));
}

// TODO: suggestions

@Override
protected PrimaryCollectionEntityService<Institution> getMockPrimaryEntityService() {
return institutionService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.gbif.api.model.collections.suggestions.ChangeSuggestionService;
import org.gbif.api.model.collections.suggestions.Status;
import org.gbif.api.model.collections.suggestions.Type;
import org.gbif.api.model.common.paging.Pageable;
import org.gbif.api.model.common.paging.PagingRequest;
import org.gbif.api.model.common.paging.PagingResponse;
import org.gbif.api.model.registry.Commentable;
Expand Down Expand Up @@ -61,7 +62,6 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doNothing;
Expand Down Expand Up @@ -253,20 +253,21 @@ public void getChangeSuggestionTest() {
public void listChangeSuggestionTest() {
R changeSuggestion = newChangeSuggestion();
changeSuggestion.setKey(1);
when(getMockChangeSuggestionService().list(any(), any(), any(), anyString(), any(), any()))
Status status = Status.PENDING;
Type type = Type.CREATE;
Country country = Country.DENMARK;
String proposedBy = "aa@aa.com";
UUID entityKey = UUID.randomUUID();
Pageable page = new PagingRequest();

when(getMockChangeSuggestionService().list(status, type, country, proposedBy, entityKey, page))
.thenReturn(
new PagingResponse<>(
new PagingRequest(), 1L, Collections.singletonList(changeSuggestion)));

PagingResponse<R> result =
getPrimaryCollectionEntityClient()
.listChangeSuggestion(
Status.PENDING,
Type.CREATE,
Country.DENMARK,
"aaa@aa.com",
UUID.randomUUID(),
new PagingRequest());
.listChangeSuggestion(status, type, country, proposedBy, entityKey, page);
assertEquals(1, result.getResults().size());
}

Expand Down

0 comments on commit 2096774

Please sign in to comment.