use of com.microsoft.graph.serializer.ISerializer in project msgraph-sdk-java by microsoftgraph.
the class GraphServiceClientTest method testOverrideOfSerializer.
@Test
public void testOverrideOfSerializer() {
ISerializer serializer = new ISerializer() {
@Override
public <T> String serializeObject(T serializableObject) {
return null;
}
@Override
public <T> T deserializeObject(String inputString, Class<T> clazz, Map<String, List<String>> responseHeaders) {
return null;
}
@Override
public <T> T deserializeObject(String inputString, Class<T> clazz) {
return null;
}
};
IGraphServiceClient client = //
GraphServiceClient.builder().authenticationProvider(//
auth).serializer(//
serializer).buildClient();
assertEquals(serializer, client.getSerializer());
assertEquals(auth, client.getAuthenticationProvider());
assertNotNull(client.getHttpProvider());
assertNotNull(client.getLogger());
assertNotNull(client.getExecutors());
assertEquals(serializer, ((DefaultHttpProvider) client.getHttpProvider()).getSerializer());
}
use of com.microsoft.graph.serializer.ISerializer in project msgraph-sdk-java by microsoftgraph.
the class BaseCollectionPageTests method testRawObject.
@Test
public void testRawObject() {
ISerializer serializer = new MockSerializer(null, null);
JsonObject jsonObject = new JsonObject();
assertNull(baseCollectionPage.getRawObject());
assertNull(baseCollectionPage.getSerializer());
baseCollectionPage.setRawObject(serializer, jsonObject);
assertNotNull(baseCollectionPage.getRawObject());
assertNotNull(baseCollectionPage.getSerializer());
assertEquals(serializer, baseCollectionPage.getSerializer());
assertEquals(jsonObject, baseCollectionPage.getRawObject());
}
use of com.microsoft.graph.serializer.ISerializer in project msgraph-sdk-java by microsoftgraph.
the class ReferenceRequestBodyTests method testRawObject.
@Test
public void testRawObject() {
ReferenceRequestBody body = new ReferenceRequestBody(null);
ISerializer serializer = new MockSerializer(null, null);
JsonObject jsonObject = new JsonObject();
body.setRawObject(serializer, jsonObject);
assertEquals(serializer, body.getSerializer());
assertEquals(jsonObject, body.getRawObject());
}
Aggregations