You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test case shows that calling issue.getRepository().getIssue(issue.getNumber()) .getClosedBy() at times yields different results from issue.getClosedBy().
Also not all closed issues return the GHuser who closed them whereas github shows the closer of the issue.
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.kohsuke.github.GHIssue;
import org.kohsuke.github.GHIssueState;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
public class IssueTester {
private static GHRepository repo;
@BeforeClass
public static void setup() {
try {
repo = GitHub.connectAnonymously().getRepository(
"kohsuke/github-api");
} catch (IOException e) {
e.printStackTrace();
}
}
// These two ways of gettting closers must return same GHUser
@Test
public void testGetCloser() {
try {
for (GHIssue issue : repo.getIssues(GHIssueState.CLOSED)) {
assertEquals(issue.getRepository().getIssue(issue.getNumber())
.getClosedBy(), issue.getClosedBy());
}
} catch (IOException e) {
e.printStackTrace();
}
}
// Every closed issue must have been closed by someone
@Test
public void testClosedIssue() {
try {
for (GHIssue issue : repo.getIssues(GHIssueState.CLOSED)) {
assert (issue.getClosedBy() != null);
assert (issue.getRepository().getIssue(issue.getNumber())
.getClosedBy() != null);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
The text was updated successfully, but these errors were encountered:
The following test case shows that calling
issue.getRepository().getIssue(issue.getNumber()) .getClosedBy()
at times yields different results fromissue.getClosedBy().
Also not all closed issues return the
GHuser
who closed them whereas github shows the closer of the issue.The text was updated successfully, but these errors were encountered: