< prev index next > bots/bridgekeeper/src/test/java/org/openjdk/skara/bots/bridgekeeper/PullRequestPrunerBotTests.java
Print this page
import static org.junit.jupiter.api.Assertions.assertEquals;
class PullRequestPrunerBotTests {
@Test
! void close(TestInfo testInfo) throws IOException {
try (var credentials = new HostCredentials(testInfo);
var tempFolder = new TemporaryDirectory()) {
var author = credentials.getHostedRepository();
var bot = new PullRequestPrunerBot(author, Duration.ofMillis(1));
import static org.junit.jupiter.api.Assertions.assertEquals;
class PullRequestPrunerBotTests {
@Test
! void close(TestInfo testInfo) throws IOException, InterruptedException {
try (var credentials = new HostCredentials(testInfo);
var tempFolder = new TemporaryDirectory()) {
var author = credentials.getHostedRepository();
var bot = new PullRequestPrunerBot(author, Duration.ofMillis(1));
// Make a change with a corresponding PR
var editHash = CheckableRepository.appendAndCommit(localRepo);
localRepo.push(editHash, author.url(), "edit", true);
var pr = credentials.createPullRequest(author, "master", "edit", "This is a pull request");
+ // Make sure the timeout expires
+ Thread.sleep(100);
+
// Let the bot see it
TestBotRunner.runPeriodicItems(bot);
// There should now be no open PRs
var prs = author.pullRequests();
< prev index next >