Search in sources :

Example 1 with PullRequestStore

use of com.cloudogu.scm.review.pullrequest.service.PullRequestStore in project scm-review-plugin by scm-manager.

the class CommentStoreTest method init.

@BeforeEach
void init() {
    PullRequestStore prStore = mock(PullRequestStore.class);
    when(prStore.get(any())).thenReturn(TestData.createPullRequest());
    store = new CommentStore(dataStore, keyGenerator);
    // delegate store methods to backing map
    when(dataStore.getAll()).thenReturn(backingMap);
    doAnswer(invocationOnMock -> {
        String id = invocationOnMock.getArgument(0);
        PullRequestComments pullRequestComments = invocationOnMock.getArgument(1);
        backingMap.put(id, pullRequestComments);
        return null;
    }).when(dataStore).put(anyString(), any(PullRequestComments.class));
}
Also used : PullRequestStore(com.cloudogu.scm.review.pullrequest.service.PullRequestStore) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PullRequestStore (com.cloudogu.scm.review.pullrequest.service.PullRequestStore)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1