use of com.microsoft.graph.http.MockConnection in project msgraph-sdk-java by microsoftgraph.
the class DefaultSeralizerTests method testResponseHeaders.
@Test
public void testResponseHeaders() throws Exception {
MockConnection connection = new MockConnection(null);
final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
User user = serializer.deserializeObject("{\"id\":\"1\"}", User.class, connection.getResponseHeaders());
JsonElement responseHeaders = user.additionalDataManager().get("graphResponseHeaders");
assertNotNull(responseHeaders);
JsonElement responseHeader = responseHeaders.getAsJsonObject().get("header1");
assertNotNull(responseHeader);
assertEquals("value1", responseHeader.getAsJsonArray().get(0).getAsString());
}
Aggregations