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 fcb8d03

Browse filesBrowse files
committed
Ensure that Description is part of GHLabel comparision
1 parent 09ec89b commit fcb8d03
Copy full SHA for fcb8d03

File tree

Expand file treeCollapse file tree

1 file changed

+21
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+21
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/AppTest.java
+21-4Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,13 @@ public void testRepoLabel() throws IOException {
803803

804804
GHLabel t = null;
805805
GHLabel t2 = null;
806+
GHLabel t3 = null;
806807
try {// CRUD
807808
t = r.createLabel("test", "123456");
808809
t2 = r.getLabel("test");
810+
assertThat(t, not(sameInstance(t2)));
811+
assertThat(t, equalTo(t2));
812+
809813
assertEquals(t.getName(), t2.getName());
810814
assertEquals(t.getColor(), "123456");
811815
assertEquals(t.getColor(), t2.getColor());
@@ -815,23 +819,36 @@ public void testRepoLabel() throws IOException {
815819

816820
// update works on multiple changes in one call
817821
// t.setColor("");
818-
t2 = t.update().color("000000").description("It is dark!").done();
822+
t3 = t.update().color("000000").description("It is dark!").done();
819823

820824
// instances behave as immutable by default. Update returns a new updated instance.
825+
assertThat(t, not(sameInstance(t2)));
826+
assertThat(t, equalTo(t2));
827+
828+
assertThat(t, not(sameInstance(t3)));
829+
assertThat(t, not(equalTo(t3)));
830+
821831
assertEquals(t.getColor(), "123456");
822832
assertEquals(t.getDescription(), "");
823-
assertEquals(t2.getColor(), "000000");
824-
assertEquals(t2.getDescription(), "It is dark!");
833+
assertEquals(t3.getColor(), "000000");
834+
assertEquals(t3.getDescription(), "It is dark!");
825835

826836
t = r.getLabel("test");
827-
GHLabel t3 = t.set().description("this is also a test");
837+
838+
t3 = t.set().description("this is also a test");
839+
840+
// instances behave as immutable by default. Update returns a new updated instance.
841+
assertThat(t, not(sameInstance(t3)));
842+
assertThat(t, not(equalTo(t3)));
828843

829844
assertEquals(t3.getColor(), "000000");
830845
assertEquals(t3.getDescription(), "this is also a test");
846+
831847
t.delete();
832848

833849
t = r.createLabel("test2", "123457", "this is a different test");
834850
t2 = r.getLabel("test2");
851+
835852
assertEquals(t.getName(), t2.getName());
836853
assertEquals(t.getColor(), "123457");
837854
assertEquals(t.getColor(), t2.getColor());

0 commit comments

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