mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-22 15:50:29 +00:00
Separate out clean-up of Pull requests created during test
If the test assertion fails, we want the pull-request to be closed anyway. You can't have more than one pull-request merging a given branch into another, so leaving the PR hanging will cause subsequent test runs to fail in setup.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.kohsuke.github;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@@ -13,6 +14,12 @@ public class PullRequestTest extends AbstractGitHubApiTestBase {
|
||||
GHPullRequest p = j.createPullRequest(name, "stable", "master", "## test");
|
||||
System.out.println(p.getUrl());
|
||||
assertEquals(name, p.getTitle());
|
||||
p.close();
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() throws Exception {
|
||||
for (GHPullRequest pr : getRepository().getPullRequests(GHIssueState.OPEN)) {
|
||||
pr.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user