File tree Expand file tree Collapse file tree
microsphere-java-core/src/test/java/io/microsphere/collection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io .microsphere .collection ;
22
3+ import org .junit .jupiter .api .BeforeEach ;
34import org .junit .jupiter .api .Test ;
45
56import java .util .NoSuchElementException ;
67
7- import static io .microsphere .collection .EmptyIterator .INSTANCE ;
88import static org .junit .jupiter .api .Assertions .assertFalse ;
99import static org .junit .jupiter .api .Assertions .assertThrows ;
1010
1717 */
1818public class EmptyIteratorTest {
1919
20+ private EmptyIterator emptyIterator ;
21+
22+ @ BeforeEach
23+ public void before () {
24+ emptyIterator = new EmptyIterator ();
25+ }
26+
2027 @ Test
2128 public void testHasNext () {
22- assertFalse (INSTANCE .hasNext ());
29+ assertFalse (emptyIterator .hasNext ());
2330 }
2431
2532 @ Test
2633 public void testNext () {
27- assertThrows (NoSuchElementException .class , INSTANCE ::next );
34+ assertThrows (NoSuchElementException .class , emptyIterator ::next );
2835 }
2936
3037 @ Test
3138 public void testRemove () {
32- assertThrows (IllegalStateException .class , INSTANCE ::remove );
39+ assertThrows (IllegalStateException .class , emptyIterator ::remove );
3340 }
3441}
You can’t perform that action at this time.
0 commit comments