diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index b2f8018929..0cc9cdbdb3 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -27,14 +27,14 @@ public class GHBranch { private String protection_url; @JsonCreator - GHBranch(@JsonProperty("name") String name) throws Exception{ + GHBranch(@JsonProperty("name") String name) throws Exception { if (name != null) { this.name = name; - } - else{ + } else { throw new GHFileNotFoundException("Branch Not Found"); } } + /** * The type Commit. */ diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 40e85230ca..f72e99c976 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -50,19 +50,18 @@ public void getBranch_URLEncoded() throws Exception { assertThat(branch.getName(), is("test/#UrlEncode")); } - //Issue #607 + // Issue #607 @Test public void getBranchNonExistentBut200Status() throws Exception { - //Manually changed the returned status to 200 so dont take a new snapshot + // Manually changed the returned status to 200 so dont take a new snapshot this.snapshotNotAllowed(); GHRepository repo = getRepository(); - try{ + try { GHBranch branch = repo.getBranch("test/NonExistent"); fail(); - } - catch(Exception e){ - //I dont really love this but I wanted to get to the root wrapped cause + } catch (Exception e) { + // I dont really love this but I wanted to get to the root wrapped cause assertEquals("Branch Not Found", e.getCause().getCause().getCause().getMessage()); } }