Skip to content

Commit

Permalink
Convention is to call these methods setXyz. Plus doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Oct 28, 2017
1 parent 569fa06 commit e94ba74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/kohsuke/github/GHLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public void delete() throws IOException {
repo.root.retrieve().method("DELETE").to(url);
}

public void updateColor(String newColor) throws IOException {
/**
* @param newColor
* 6-letter hex color code, like "f29513"
*/
public void setColor(String newColor) throws IOException {
repo.root.retrieve().method("PATCH").with("name", name).with("color", newColor).to(url);
}
}
2 changes: 1 addition & 1 deletion src/test/java/org/kohsuke/github/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public void testRepoLabel() throws IOException {
assertEquals(t.getColor(), t2.getColor());
assertEquals(t.getUrl(), t2.getUrl());

t.updateColor("000000");
t.setColor("000000");
GHLabel t3 = r.getLabel("test");
assertEquals(t3.getColor(), "000000");
t.delete();
Expand Down

0 comments on commit e94ba74

Please sign in to comment.