mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
PullRequest.setMilestone should use the Issue API
This commit is contained in:
@@ -70,6 +70,24 @@ public class GHMilestoneTest extends AbstractGitHubWireMockTest {
|
||||
assertEquals(null, issue.getMilestone());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsetMilestoneFromPullRequest() throws IOException {
|
||||
GHRepository repo = getRepository();
|
||||
GHMilestone milestone = repo.createMilestone("Unset Test Milestone", "For testUnsetMilestone");
|
||||
GHPullRequest p = getRepository()
|
||||
.createPullRequest("testUnsetMilestoneFromPullRequest", "test/stable", "master", "## test");
|
||||
|
||||
// set the milestone
|
||||
p.setMilestone(milestone);
|
||||
p = repo.getPullRequest(p.getNumber()); // force reload
|
||||
assertEquals(milestone.getNumber(), p.getMilestone().getNumber());
|
||||
|
||||
// remove the milestone
|
||||
p.setMilestone(null);
|
||||
p = repo.getPullRequest(p.getNumber()); // force reload
|
||||
assertNull(p.getMilestone());
|
||||
}
|
||||
|
||||
protected GHRepository getRepository() throws IOException {
|
||||
return getRepository(gitHub);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user