11package org .kohsuke .github ;
22
33import org .junit .Test ;
4- import static org .junit .Assert .assertThrows ;
54
65import java .util .UUID ;
76
87import static org .hamcrest .Matchers .is ;
98import static org .hamcrest .Matchers .notNullValue ;
9+ import static org .junit .Assert .assertThrows ;
1010
1111public class ReleaseTest extends AbstractGitHubWireMockTest {
1212
@@ -17,7 +17,11 @@ public void testCreateSimpleRelease() throws Exception {
1717 String tagName = UUID .randomUUID ().toString ();
1818 String releaseName = "release-" + tagName ;
1919
20- GHRelease release = repo .createRelease (tagName ).name (releaseName ).categoryName ("announcements" ).prerelease (false ).create ();
20+ GHRelease release = repo .createRelease (tagName )
21+ .name (releaseName )
22+ .categoryName ("announcements" )
23+ .prerelease (false )
24+ .create ();
2125
2226 GHRelease releaseCheck = repo .getRelease (release .getId ());
2327
@@ -27,7 +31,7 @@ public void testCreateSimpleRelease() throws Exception {
2731 }
2832
2933 @ Test
30- public void testCreateDoubleReleaseFails () throws Exception {
34+ public void testCreateDoubleReleaseFails () throws Exception {
3135 GHRepository repo = gitHub .getRepository ("hub4j-test-org/testCreateRelease" );
3236
3337 String tagName = UUID .randomUUID ().toString ();
@@ -37,8 +41,9 @@ public void testCreateDoubleReleaseFails() throws Exception{
3741 GHRelease releaseCheck = repo .getRelease (release .getId ());
3842 assertThat (releaseCheck , notNullValue ());
3943
40- HttpException httpException = assertThrows (
41- HttpException .class , () -> {repo .createRelease (tagName ).name (releaseName ).create ();});
44+ HttpException httpException = assertThrows (HttpException .class , () -> {
45+ repo .createRelease (tagName ).name (releaseName ).create ();
46+ });
4247
4348 assertThat (httpException .getResponseCode (), is (422 ));
4449 }
@@ -50,7 +55,13 @@ public void testCreateReleaseWithUnknownCategoryFails() throws Exception {
5055 String tagName = UUID .randomUUID ().toString ();
5156 String releaseName = "release-" + tagName ;
5257
53- assertThrows (GHFileNotFoundException .class , () -> { repo .createRelease (tagName ).name (releaseName ).categoryName ("an invalid cateogry" ).prerelease (false ).create (); });
58+ assertThrows (GHFileNotFoundException .class , () -> {
59+ repo .createRelease (tagName )
60+ .name (releaseName )
61+ .categoryName ("an invalid cateogry" )
62+ .prerelease (false )
63+ .create ();
64+ });
5465 }
5566
5667}
0 commit comments