Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bde6ad9

Browse filesBrowse files
committed
Add a test for check updates
1 parent 4953f45 commit bde6ad9
Copy full SHA for bde6ad9

File tree

Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed

‎src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,26 @@ public void createCheckRunErrMissingConclusion() throws Exception {
114114
}
115115
}
116116

117+
@Test
118+
public void updateCheckRun() throws Exception {
119+
GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test")
120+
.createCheckRun("foo", "4a929d464a2fae7ee899ce603250f7dab304bc4b")
121+
.withStatus(GHCheckRun.Status.IN_PROGRESS)
122+
.withStartedAt(new Date(999_999_000))
123+
.add(new GHCheckRunBuilder.Output("Some Title", "what happened…")
124+
.add(new GHCheckRunBuilder.Annotation("stuff.txt",
125+
1,
126+
GHCheckRun.AnnotationLevel.NOTICE,
127+
"hello to you too").withTitle("Look here")))
128+
.create();
129+
GHCheckRun updated = checkRun.update()
130+
.withStatus(GHCheckRun.Status.COMPLETED)
131+
.withConclusion(GHCheckRun.Conclusion.SUCCESS)
132+
.withCompletedAt(new Date(999_999_999))
133+
.create();
134+
assertEquals(updated.getStartedAt(), new Date(999_999_000));
135+
assertEquals(updated.getName(), "foo");
136+
assertEquals(1, checkRun.getOutput().getAnnotationsCount());
137+
}
138+
117139
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.