Search in sources :

Example 1 with GithubIssue

use of org.jetbrains.plugins.github.api.data.GithubIssue in project intellij-community by JetBrains.

the class GithubIssuesTest method testQueriedIssues1.

public void testQueriedIssues1() throws Exception {
    List<GithubIssue> result = GithubApiUtil.getIssuesQueried(new GithubConnection(myAuth), myLogin2, REPO_NAME, null, "abracadabra", true);
    List<Long> issues = ContainerUtil.map(result, new Function<GithubIssue, Long>() {

        @Override
        public Long fun(GithubIssue githubIssue) {
            return githubIssue.getNumber();
        }
    });
    List<Long> expected = Arrays.asList(10L, 12L);
    assertTrue(Comparing.haveEqualElements(issues, expected));
}
Also used : GithubConnection(org.jetbrains.plugins.github.api.GithubConnection) GithubIssue(org.jetbrains.plugins.github.api.data.GithubIssue)

Example 2 with GithubIssue

use of org.jetbrains.plugins.github.api.data.GithubIssue in project intellij-community by JetBrains.

the class GithubIssuesTest method testAssigneeIssues2.

public void testAssigneeIssues2() throws Exception {
    List<GithubIssue> result = GithubApiUtil.getIssuesAssigned(new GithubConnection(myAuth), myLogin2, REPO_NAME, myLogin2, 100, false);
    List<Long> issues = ContainerUtil.map(result, new Function<GithubIssue, Long>() {

        @Override
        public Long fun(GithubIssue githubIssue) {
            return githubIssue.getNumber();
        }
    });
    List<Long> expected = Arrays.asList(1L, 2L);
    assertTrue(Comparing.haveEqualElements(issues, expected));
}
Also used : GithubConnection(org.jetbrains.plugins.github.api.GithubConnection) GithubIssue(org.jetbrains.plugins.github.api.data.GithubIssue)

Example 3 with GithubIssue

use of org.jetbrains.plugins.github.api.data.GithubIssue in project intellij-community by JetBrains.

the class GithubIssuesTest method testAssigneeIssues5.

public void testAssigneeIssues5() throws Exception {
    List<GithubIssue> result = GithubApiUtil.getIssuesAssigned(new GithubConnection(myAuth), myLogin2, REPO_NAME, myLogin2, 100, true);
    List<Long> issues = ContainerUtil.map(result, new Function<GithubIssue, Long>() {

        @Override
        public Long fun(GithubIssue githubIssue) {
            return githubIssue.getNumber();
        }
    });
    List<Long> expected = Arrays.asList(1L, 2L);
    assertTrue(Comparing.haveEqualElements(issues, expected));
}
Also used : GithubConnection(org.jetbrains.plugins.github.api.GithubConnection) GithubIssue(org.jetbrains.plugins.github.api.data.GithubIssue)

Example 4 with GithubIssue

use of org.jetbrains.plugins.github.api.data.GithubIssue in project intellij-community by JetBrains.

the class GithubIssuesTest method testAssigneeIssues6.

public void testAssigneeIssues6() throws Exception {
    List<GithubIssue> result = GithubApiUtil.getIssuesAssigned(new GithubConnection(myAuth), myLogin2, REPO_NAME, "", 100, true);
    List<Long> issues = ContainerUtil.map(result, new Function<GithubIssue, Long>() {

        @Override
        public Long fun(GithubIssue githubIssue) {
            return githubIssue.getNumber();
        }
    });
    List<Long> expected = Arrays.asList(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L);
    assertTrue(Comparing.haveEqualElements(issues, expected));
}
Also used : GithubConnection(org.jetbrains.plugins.github.api.GithubConnection) GithubIssue(org.jetbrains.plugins.github.api.data.GithubIssue)

Example 5 with GithubIssue

use of org.jetbrains.plugins.github.api.data.GithubIssue in project intellij-community by JetBrains.

the class GithubIssuesTest method testAssigneeIssues4.

public void testAssigneeIssues4() throws Exception {
    List<GithubIssue> result = GithubApiUtil.getIssuesAssigned(new GithubConnection(myAuth), myLogin2, REPO_NAME, myLogin1, 100, true);
    List<Long> issues = ContainerUtil.map(result, new Function<GithubIssue, Long>() {

        @Override
        public Long fun(GithubIssue githubIssue) {
            return githubIssue.getNumber();
        }
    });
    List<Long> expected = Arrays.asList(3L, 6L, 7L, 8L);
    assertTrue(Comparing.haveEqualElements(issues, expected));
}
Also used : GithubConnection(org.jetbrains.plugins.github.api.GithubConnection) GithubIssue(org.jetbrains.plugins.github.api.data.GithubIssue)

Aggregations

GithubConnection (org.jetbrains.plugins.github.api.GithubConnection)10 GithubIssue (org.jetbrains.plugins.github.api.data.GithubIssue)10 NotNull (org.jetbrains.annotations.NotNull)1