13
13
import static org .junit .Assert .assertSame ;
14
14
import static org .junit .Assert .assertTrue ;
15
15
import static org .mockito .ArgumentMatchers .anyMap ;
16
- import static org .mockito .Matchers .anyString ;
17
- import static org .mockito .Matchers .eq ;
18
- import static org .mockito .Matchers .isNull ;
16
+ import static org .mockito .ArgumentMatchers .anyString ;
17
+ import static org .mockito .ArgumentMatchers .eq ;
18
+ import static org .mockito .ArgumentMatchers .isNull ;
19
19
import static org .mockito .Mockito .mock ;
20
20
import static org .mockito .Mockito .times ;
21
21
import static org .mockito .Mockito .verify ;
36
36
import org .junit .Before ;
37
37
import org .junit .Test ;
38
38
import org .junit .runner .RunWith ;
39
- import org .mockito .Matchers ;
40
39
import org .robolectric .RobolectricTestRunner ;
41
40
import org .robolectric .annotation .LooperMode ;
42
41
@@ -92,26 +91,23 @@ public void testTrackEventInBackgroundEmptyName() throws Exception {
92
91
public void testTrackEventInBackgroundNormalName () throws Exception {
93
92
ParseTaskUtils .wait (ParseAnalytics .trackEventInBackground ("test" ));
94
93
95
- verify (controller , times (1 ))
96
- .trackEventInBackground (eq ("test" ), Matchers .eq (null ), isNull (String .class ));
94
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (null ), isNull ());
97
95
}
98
96
99
97
@ Test
100
98
public void testTrackEventInBackgroundNullParameters () throws Exception {
101
99
ParseTaskUtils .wait (
102
100
ParseAnalytics .trackEventInBackground ("test" , (Map <String , String >) null ));
103
101
104
- verify (controller , times (1 ))
105
- .trackEventInBackground (eq ("test" ), Matchers .eq (null ), isNull (String .class ));
102
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (null ), isNull ());
106
103
}
107
104
108
105
@ Test
109
106
public void testTrackEventInBackgroundEmptyParameters () throws Exception {
110
107
Map <String , String > dimensions = new HashMap <>();
111
108
ParseTaskUtils .wait (ParseAnalytics .trackEventInBackground ("test" , dimensions ));
112
109
113
- verify (controller , times (1 ))
114
- .trackEventInBackground (eq ("test" ), eq (dimensions ), isNull (String .class ));
110
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (dimensions ), isNull ());
115
111
}
116
112
117
113
@ Test
@@ -120,17 +116,15 @@ public void testTrackEventInBackgroundNormalParameters() throws Exception {
120
116
dimensions .put ("key" , "value" );
121
117
ParseTaskUtils .wait (ParseAnalytics .trackEventInBackground ("test" , dimensions ));
122
118
123
- verify (controller , times (1 ))
124
- .trackEventInBackground (eq ("test" ), eq (dimensions ), isNull (String .class ));
119
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (dimensions ), isNull ());
125
120
}
126
121
127
122
@ Test
128
123
public void testTrackEventInBackgroundNullCallback () {
129
124
Map <String , String > dimensions = new HashMap <>();
130
125
ParseAnalytics .trackEventInBackground ("test" , dimensions , null );
131
126
132
- verify (controller , times (1 ))
133
- .trackEventInBackground (eq ("test" ), eq (dimensions ), isNull (String .class ));
127
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (dimensions ), isNull ());
134
128
}
135
129
136
130
@ Test
@@ -150,8 +144,7 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {
150
144
151
145
// Make sure the callback is called
152
146
assertTrue (done .tryAcquire (1 , 10 , TimeUnit .SECONDS ));
153
- verify (controller , times (1 ))
154
- .trackEventInBackground (eq ("test" ), eq (dimensions ), isNull (String .class ));
147
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (dimensions ), isNull ());
155
148
156
149
final Semaphore doneAgain = new Semaphore (0 );
157
150
ParseAnalytics .trackEventInBackground (
@@ -165,8 +158,7 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {
165
158
166
159
// Make sure the callback is called
167
160
assertTrue (doneAgain .tryAcquire (1 , 10 , TimeUnit .SECONDS ));
168
- verify (controller , times (1 ))
169
- .trackEventInBackground (eq ("test" ), Matchers .eq (null ), isNull (String .class ));
161
+ verify (controller , times (1 )).trackEventInBackground (eq ("test" ), eq (null ), isNull ());
170
162
}
171
163
172
164
// endregion
@@ -177,45 +169,43 @@ public void testTrackEventInBackgroundNormalCallback() throws Exception {
177
169
public void testTrackAppOpenedInBackgroundNullIntent () throws Exception {
178
170
ParseTaskUtils .wait (ParseAnalytics .trackAppOpenedInBackground (null ));
179
171
180
- verify (controller , times (1 ))
181
- .trackAppOpenedInBackground (isNull (String .class ), isNull (String .class ));
172
+ verify (controller , times (1 )).trackAppOpenedInBackground (isNull (), isNull ());
182
173
}
183
174
184
175
@ Test
185
176
public void testTrackAppOpenedInBackgroundEmptyIntent () throws Exception {
186
177
Intent intent = new Intent ();
187
178
ParseTaskUtils .wait (ParseAnalytics .trackAppOpenedInBackground (intent ));
188
179
189
- verify (controller , times (1 ))
190
- .trackAppOpenedInBackground (isNull (String .class ), isNull (String .class ));
180
+ verify (controller , times (1 )).trackAppOpenedInBackground (isNull (), isNull ());
191
181
}
192
182
193
183
@ Test
194
184
public void testTrackAppOpenedInBackgroundNormalIntent () throws Exception {
195
185
Intent intent = makeIntentWithParseData ("test" );
196
186
ParseTaskUtils .wait (ParseAnalytics .trackAppOpenedInBackground (intent ));
197
187
198
- verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull (String . class ));
188
+ verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull ());
199
189
}
200
190
201
191
@ Test
202
192
public void testTrackAppOpenedInBackgroundDuplicatedIntent () throws Exception {
203
193
Intent intent = makeIntentWithParseData ("test" );
204
194
ParseTaskUtils .wait (ParseAnalytics .trackAppOpenedInBackground (intent ));
205
195
206
- verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull (String . class ));
196
+ verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull ());
207
197
208
198
ParseTaskUtils .wait (ParseAnalytics .trackAppOpenedInBackground (intent ));
209
199
210
- verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull (String . class ));
200
+ verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull ());
211
201
}
212
202
213
203
@ Test
214
204
public void testTrackAppOpenedInBackgroundNullCallback () throws Exception {
215
205
Intent intent = makeIntentWithParseData ("test" );
216
206
ParseAnalytics .trackAppOpenedInBackground (intent , null );
217
207
218
- verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull (String . class ));
208
+ verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull ());
219
209
}
220
210
221
211
@ Test
@@ -233,7 +223,7 @@ public void testTrackAppOpenedInBackgroundNormalCallback() throws Exception {
233
223
234
224
// Make sure the callback is called
235
225
assertTrue (done .tryAcquire (1 , 10 , TimeUnit .SECONDS ));
236
- verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull (String . class ));
226
+ verify (controller , times (1 )).trackAppOpenedInBackground (eq ("test" ), isNull ());
237
227
}
238
228
239
229
// endregion
0 commit comments