NPE when there are no annotations

This commit is contained in:
Jesse Glick
2020-03-26 19:07:35 -04:00
parent b4c4a05f3b
commit c01f3f5e8a
7 changed files with 276 additions and 1 deletions

View File

@@ -72,4 +72,17 @@ public class GHCheckRunBuilderTest extends AbstractGitHubWireMockTest {
assertEquals(537614832, checkRun.id);
}
@Test
public void createCheckRunNoAnnotations() throws Exception {
GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test")
.createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b")
.withConclusion(GHCheckRun.Conclusion.NEUTRAL)
.withOutput("Quick note", "nothing more to see here")
.done()
.create();
assertEquals("completed", checkRun.getStatus());
assertEquals(0, checkRun.getOutput().getAnnotationsCount());
assertEquals(538002758, checkRun.id);
}
}