|
1 | 1 | package com.microsoft.graph.http; |
2 | 2 |
|
3 | | -import static org.junit.Assert.assertEquals; |
4 | | -import static org.junit.Assert.assertNotNull; |
5 | | -import static org.junit.Assert.assertNull; |
6 | | -import static org.mockito.Mockito.doAnswer; |
7 | | -import static org.mockito.Mockito.doNothing; |
8 | | -import static org.mockito.Mockito.mock; |
9 | | -import static org.mockito.Mockito.when; |
10 | | -import static org.mockito.Mockito.anyObject; |
11 | | - |
12 | | -import java.util.ArrayList; |
13 | | -import java.util.Arrays; |
14 | | -import java.util.HashMap; |
15 | | -import java.util.Map; |
| 3 | +import com.google.gson.JsonObject; |
| 4 | +import com.google.gson.JsonPrimitive; |
16 | 5 |
|
17 | | -import javax.annotation.meta.When; |
| 6 | +import com.microsoft.graph.core.IBaseClient; |
| 7 | +import com.microsoft.graph.logger.ILogger; |
| 8 | +import com.microsoft.graph.options.FunctionOption; |
| 9 | +import com.microsoft.graph.options.Option; |
| 10 | +import com.microsoft.graph.options.QueryOption; |
| 11 | +import com.microsoft.graph.serializer.ISerializer; |
18 | 12 |
|
19 | 13 | import org.junit.Before; |
20 | 14 | import org.junit.Test; |
21 | | -import org.mockito.Mockito; |
22 | 15 |
|
23 | | -import okhttp3.Call; |
| 16 | +import java.util.ArrayList; |
| 17 | +import java.util.Arrays; |
| 18 | + |
24 | 19 | import okhttp3.MediaType; |
25 | 20 | import okhttp3.OkHttpClient; |
26 | 21 | import okhttp3.Protocol; |
27 | 22 | import okhttp3.Request; |
28 | 23 | import okhttp3.Response; |
29 | 24 | import okhttp3.ResponseBody; |
30 | 25 |
|
31 | | -import com.google.gson.JsonObject; |
32 | | -import com.google.gson.JsonPrimitive; |
33 | | -import com.microsoft.graph.core.IBaseClient; |
34 | | -import com.microsoft.graph.logger.ILogger; |
35 | | -import com.microsoft.graph.options.FunctionOption; |
36 | | -import com.microsoft.graph.options.Option; |
37 | | -import com.microsoft.graph.options.QueryOption; |
38 | | -import com.microsoft.graph.serializer.ISerializer; |
| 26 | +import static org.junit.Assert.assertEquals; |
| 27 | +import static org.junit.Assert.assertNotNull; |
| 28 | +import static org.junit.Assert.assertNull; |
| 29 | +import static org.mockito.ArgumentMatchers.any; |
| 30 | +import static org.mockito.ArgumentMatchers.anyString; |
| 31 | +import static org.mockito.Mockito.mock; |
| 32 | +import static org.mockito.Mockito.when; |
39 | 33 |
|
40 | 34 | /** |
41 | 35 | * Test cases for {@see BaseCollectionRequest} |
@@ -79,10 +73,10 @@ public void setUp() throws Exception { |
79 | 73 | resultobj.add("id", new JsonPrimitive("zzz")); |
80 | 74 | @SuppressWarnings("unchecked") |
81 | 75 | final ICollectionResponse<JsonObject> result = mock(ICollectionResponse.class); |
82 | | - when(result.values()).thenReturn(new ArrayList<JsonObject>(Arrays.asList(resultobj))); |
| 76 | + when(result.values()).thenReturn(new ArrayList<>(Arrays.asList(resultobj))); |
83 | 77 | final ISerializer mSerializer = mock(ISerializer.class); |
84 | | - when(mSerializer.deserializeObject(anyObject(), anyObject(), anyObject())).thenReturn(result); |
85 | | - when(mSerializer.serializeObject(anyObject())).thenReturn("[{ \"id\": \"zzz\" }]"); |
| 78 | + when(mSerializer.deserializeObject(anyString(), any())).thenReturn(result); |
| 79 | + when(mSerializer.serializeObject(any())).thenReturn("[{ \"id\": \"zzz\" }]"); |
86 | 80 | CoreHttpProvider mProvider = new CoreHttpProvider(mSerializer, |
87 | 81 | mock(ILogger.class), |
88 | 82 | mockClient); |
|
0 commit comments