Skip to content

Commit

Permalink
Adjusted format
Browse files Browse the repository at this point in the history
Adjusted format according to standard from repo
  • Loading branch information
Alex Taylor committed Nov 15, 2019
1 parent 18aa067 commit 6af796f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
11 changes: 5 additions & 6 deletions src/test/java/org/kohsuke/github/GHRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down

0 comments on commit 6af796f

Please sign in to comment.