|
17 | 17 | package com.ctrip.framework.apollo.internals; |
18 | 18 |
|
19 | 19 | import static org.junit.Assert.assertEquals; |
| 20 | +import static org.mockito.ArgumentMatchers.any; |
| 21 | +import static org.mockito.ArgumentMatchers.eq; |
20 | 22 | import static org.mockito.Mockito.spy; |
21 | 23 | import static org.mockito.Mockito.times; |
22 | 24 | import static org.mockito.Mockito.verify; |
|
36 | 38 | import java.util.concurrent.TimeoutException; |
37 | 39 | import java.util.concurrent.atomic.AtomicInteger; |
38 | 40 | import org.junit.Test; |
39 | | -import org.mockito.Matchers; |
40 | 41 |
|
41 | 42 | /** |
42 | 43 | * @author wxq |
@@ -71,7 +72,7 @@ public void onChange(ConfigChangeEvent changeEvent) { |
71 | 72 | // wait a minute for invoking |
72 | 73 | Thread.sleep(100); |
73 | 74 |
|
74 | | - verify(configChangeListener, times(0)).onChange(Matchers.<ConfigChangeEvent>any()); |
| 75 | + verify(configChangeListener, times(0)).onChange(any()); |
75 | 76 | } |
76 | 77 |
|
77 | 78 | @Test |
@@ -115,8 +116,8 @@ public void onChange(ConfigChangeEvent changeEvent) { |
115 | 116 |
|
116 | 117 | assertEquals(2, invokeCount.get()); |
117 | 118 |
|
118 | | - verify(configChangeListener1, times(1)).onChange(Matchers.eq(configChangeEvent)); |
119 | | - verify(configChangeListener2, times(1)).onChange(Matchers.eq(configChangeEvent)); |
| 119 | + verify(configChangeListener1, times(1)).onChange(eq(configChangeEvent)); |
| 120 | + verify(configChangeListener2, times(1)).onChange(eq(configChangeEvent)); |
120 | 121 | } |
121 | 122 |
|
122 | 123 | @Test |
@@ -159,8 +160,8 @@ public void onChange(ConfigChangeEvent changeEvent) { |
159 | 160 |
|
160 | 161 | assertEquals(2, invokeCount.get()); |
161 | 162 |
|
162 | | - verify(configChangeListener1, times(1)).onChange(Matchers.<ConfigChangeEvent>any()); |
163 | | - verify(configChangeListener2, times(1)).onChange(Matchers.<ConfigChangeEvent>any()); |
| 163 | + verify(configChangeListener1, times(1)).onChange(any()); |
| 164 | + verify(configChangeListener2, times(1)).onChange(any()); |
164 | 165 | } |
165 | 166 |
|
166 | 167 | /** |
|
0 commit comments