Handle >50 annotations

This commit is contained in:
Jesse Glick
2020-03-26 16:14:39 -04:00
parent 03de12c221
commit 26b8082155
10 changed files with 521 additions and 6 deletions

View File

@@ -52,7 +52,24 @@ public class GHCheckRunBuilderTest extends AbstractGitHubWireMockTest {
.withAction("Help", "what I need help with", "doit")
.create();
assertEquals("completed", checkRun.getStatus());
assertEquals(1, checkRun.getOutput().getAnnotationsCount());
assertEquals(535049329, checkRun.id);
}
@Test
public void createCheckRunManyAnnotations() throws Exception {
GHCheckRunBuilder.DraftOutput output = gitHub.getRepository("jglick/github-api-test")
.createCheckRun("big", "4a929d464a2fae7ee899ce603250f7dab304bc4b")
.withConclusion(GHCheckRunConclusion.SUCCESS)
.withOutput("Big Run", "Lots of stuff here »");
for (int i = 0; i < 101; i++) {
output.withAnnotation("stuff.txt", 1, GHCheckRunAnnotationLevel.NOTICE, "hello #" + i).done();
}
GHCheckRun checkRun = output.done().create();
assertEquals("completed", checkRun.getStatus());
assertEquals("Big Run", checkRun.getOutput().getTitle());
assertEquals(101, checkRun.getOutput().getAnnotationsCount());
assertEquals(537614832, checkRun.id);
}
}