Newly created user object resets root to null.

Fixes issue #111.
Test case from KostyaSha
This commit is contained in:
Kohsuke Kawaguchi
2015-02-15 07:13:33 -08:00
parent 7bbe0f7e8a
commit 9afad71b0f
3 changed files with 23 additions and 12 deletions

View File

@@ -38,6 +38,22 @@ public class PullRequestTest extends AbstractGitHubApiTestBase {
assertEquals(user, getRepository().getPullRequest(p.getNumber()).getAssignee());
}
@Test
public void testGetUser() throws IOException {
GHPullRequest p = getRepository().createPullRequest(rnd.next(), "stable", "master", "## test");
GHPullRequest prSingle = getRepository().getPullRequest(p.getNumber());
assertNotNull(prSingle.getUser().root);
prSingle.getMergeable();
assertNotNull(prSingle.getUser().root);
PagedIterable<GHPullRequest> ghPullRequests = getRepository().listPullRequests(GHIssueState.OPEN);
for (GHPullRequest pr : ghPullRequests) {
assertNotNull(pr.getUser().root);
assertFalse(pr.getMergeable());
assertNotNull(pr.getUser().root);
}
}
@After
public void cleanUp() throws Exception {
for (GHPullRequest pr : getRepository().getPullRequests(GHIssueState.OPEN)) {