Skip to content

Commit 9346585

Browse files
minor updates
1 parent e7a1406 commit 9346585

2 files changed

Lines changed: 37 additions & 26 deletions

File tree

‎src/main/java/com/microsoft/graph/serializer/ISerializer.java‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,19 @@ public interface ISerializer {
3737
/**
3838
* Deserialize an object from the input string
3939
*
40-
* @param inputStream the string that stores the representation of the item
41-
* @param clazz the .class of the item to be deserialized
40+
* @param inputString the string that stores the representation of the item
41+
* @param clazz the {@code Class} of the item to be deserialized
42+
* @param <T> the type of the item to be deserialized
43+
* @return the deserialized item from the input string
44+
*/
45+
@Nullable
46+
<T> T deserializeObject(@Nonnull final String inputString, @Nonnull final Class<T> clazz);
47+
48+
/**
49+
* Deserialize an object from the input string
50+
*
51+
* @param inputStream the stream that stores the representation of the item
52+
* @param clazz the {@code Class} of the item to be deserialized
4253
* @param <T> the type of the item to be deserialized
4354
* @return the deserialized item from the input string
4455
*/

‎src/test/java/com/microsoft/graph/http/CoreHttpProviderTests.java‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
package com.microsoft.graph.http;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertFalse;
5-
import static org.junit.Assert.assertTrue;
6-
import static org.junit.Assert.fail;
3+
import com.google.common.collect.ImmutableMap;
4+
import com.google.common.collect.Maps;
5+
import com.google.gson.Gson;
6+
import com.google.gson.GsonBuilder;
7+
import com.google.gson.JsonObject;
8+
import com.google.gson.JsonPrimitive;
9+
10+
import com.microsoft.graph.core.GraphErrorCodes;
11+
import com.microsoft.graph.logger.ILogger;
12+
import com.microsoft.graph.logger.LoggerLevel;
13+
import com.microsoft.graph.options.HeaderOption;
14+
import com.microsoft.graph.serializer.DefaultSerializer;
15+
import com.microsoft.graph.serializer.ISerializer;
16+
17+
import org.junit.Test;
718

819
import java.io.ByteArrayInputStream;
920
import java.io.IOException;
@@ -12,17 +23,6 @@
1223
import java.nio.charset.StandardCharsets;
1324
import java.util.Arrays;
1425

15-
import static org.mockito.Mockito.mock;
16-
import static org.mockito.Mockito.when;
17-
import static org.mockito.ArgumentMatchers.any;
18-
import static org.mockito.ArgumentMatchers.anyString;
19-
20-
import com.google.common.collect.ImmutableMap;
21-
import com.google.common.collect.Maps;
22-
import com.google.gson.Gson;
23-
import com.google.gson.GsonBuilder;
24-
import org.junit.Test;
25-
2626
import okhttp3.Call;
2727
import okhttp3.MediaType;
2828
import okhttp3.OkHttpClient;
@@ -31,14 +31,14 @@
3131
import okhttp3.Response;
3232
import okhttp3.ResponseBody;
3333

34-
import com.google.gson.JsonObject;
35-
import com.google.gson.JsonPrimitive;
36-
import com.microsoft.graph.core.GraphErrorCodes;
37-
import com.microsoft.graph.logger.ILogger;
38-
import com.microsoft.graph.logger.LoggerLevel;
39-
import com.microsoft.graph.options.HeaderOption;
40-
import com.microsoft.graph.serializer.DefaultSerializer;
41-
import com.microsoft.graph.serializer.ISerializer;
34+
import static org.junit.Assert.assertEquals;
35+
import static org.junit.Assert.assertFalse;
36+
import static org.junit.Assert.assertTrue;
37+
import static org.junit.Assert.fail;
38+
import static org.mockito.ArgumentMatchers.any;
39+
import static org.mockito.ArgumentMatchers.anyString;
40+
import static org.mockito.Mockito.mock;
41+
import static org.mockito.Mockito.when;
4242

4343
public class CoreHttpProviderTests {
4444

@@ -84,7 +84,7 @@ public void testVerboseErrorResponse() throws Exception {
8484
final ILogger logger = mock(ILogger.class);
8585
when(logger.getLoggingLevel()).thenReturn(LoggerLevel.DEBUG);
8686
final ISerializer serializer = mock(ISerializer.class);
87-
when(serializer.deserializeObject(any(), any())).thenReturn(toSerialize);
87+
when(serializer.deserializeObject(anyString(), any())).thenReturn(toSerialize);
8888

8989
mProvider = new CoreHttpProvider(serializer,
9090
logger,

0 commit comments

Comments
 (0)