mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
Use Collections#singletonList where possible
This commit is contained in:
1 parent
e6fb6cce38
commit
578a5e8377
2 files changed
+4
-3
No files matched your search
@@ -144,7 +144,7 @@ public class FunctionsTest {
|
||||
when(j.getItemGroup()).thenReturn(j);
|
||||
createMockAncestors(req, createAncestor(view, "."), createAncestor(j, "../.."));
|
||||
TopLevelItem i = createMockItem(parent, "job/i/");
|
||||
when(view.getItems()).thenReturn(Arrays.asList(i));
|
||||
when(view.getItems()).thenReturn(Collections.singletonList(i));
|
||||
String result = Functions.getRelativeLinkTo(i);
|
||||
assertEquals("job/i/", result);
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class FunctionsTest {
|
||||
when(parent.getItemGroup()).thenReturn(parent);
|
||||
createMockAncestors(req, createAncestor(j, "../../.."), createAncestor(parent, "../.."), createAncestor(view, "."));
|
||||
TopLevelItem i = createMockItem(parent, "job/i/", "parent/job/i/");
|
||||
when(view.getItems()).thenReturn(Arrays.asList(i));
|
||||
when(view.getItems()).thenReturn(Collections.singletonList(i));
|
||||
String result = Functions.getRelativeLinkTo(i);
|
||||
assertEquals("job/i/", result);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user