1313
1414import static org .junit .Assert .assertEquals ;
1515import static org .junit .Assert .assertNotEquals ;
16+ import static org .junit .Assert .assertNull ;
1617import static org .mockito .Mockito .doReturn ;
1718import static org .mockito .Mockito .mock ;
1819import static org .mockito .Mockito .spy ;
@@ -35,6 +36,13 @@ public void fetch() {
3536 };
3637 }
3738
39+ public static PlayQueueItem makeItemWithUrl (final String url ) {
40+ final StreamInfoItem infoItem = new StreamInfoItem (
41+ 0 , url , "" , StreamType .VIDEO_STREAM
42+ );
43+ return new PlayQueueItem (infoItem );
44+ }
45+
3846 public static class SetIndexTests {
3947 private static final int SIZE = 5 ;
4048 private PlayQueue nonEmptyQueue ;
@@ -103,22 +111,8 @@ public void indexZero() {
103111 }
104112
105113 public static class EqualsTests {
106- private PlayQueueItem item1 ;
107- private PlayQueueItem item2 ;
108-
109- @ Before
110- public void setup () {
111- final String url1 = "www.website1.com" ;
112- final String url2 = "www.website2.com" ;
113- final StreamInfoItem info1 = new StreamInfoItem (
114- 0 , url1 , "" , StreamType .VIDEO_STREAM
115- );
116- final StreamInfoItem info2 = new StreamInfoItem (
117- 0 , url2 , "" , StreamType .VIDEO_STREAM
118- );
119- item1 = new PlayQueueItem (info1 );
120- item2 = new PlayQueueItem (info2 );
121- }
114+ private final PlayQueueItem item1 = makeItemWithUrl ("URL_1" );
115+ private final PlayQueueItem item2 = makeItemWithUrl ("URL_2" );
122116
123117 @ Test
124118 public void sameStreams () {
0 commit comments