1
2
3
4
5 package com.jcabi.github.mock;
6
7 import com.jcabi.github.Repo;
8 import com.jcabi.github.User;
9 import java.io.IOException;
10 import org.hamcrest.MatcherAssert;
11 import org.hamcrest.Matchers;
12 import org.junit.jupiter.api.Test;
13
14
15
16
17
18
19 final class MkAssigneesTest {
20
21
22
23
24
25 @Test
26 void iteratesAssignees() throws Exception {
27 MatcherAssert.assertThat(
28 "Collection is not empty",
29 MkAssigneesTest.repo().assignees().iterate(),
30 Matchers.not(Matchers.emptyIterableOf(User.class))
31 );
32 }
33
34
35
36
37
38 @Test
39 void checkCollaboratorIsAssigneeForRepo() throws Exception {
40 final Repo repo = MkAssigneesTest.repo();
41 repo.collaborators().add("Vladimir");
42 MatcherAssert.assertThat(
43 "Values are not equal",
44 repo.assignees().check("Vladimir"),
45 Matchers.is(true)
46 );
47 }
48
49
50
51
52
53 @Test
54 void checkOwnerIsAssigneeForRepo() throws Exception {
55 MatcherAssert.assertThat(
56 "Values are not equal",
57 MkAssigneesTest.repo().assignees().check("Jonathan"),
58 Matchers.is(true)
59 );
60 }
61
62
63
64
65
66 private static Repo repo() throws IOException {
67 return new MkGitHub("Jonathan").randomRepo();
68 }
69 }