|
30 | 30 | import com.microsoft.graph.models.extensions.ServicePrincipal; |
31 | 31 | import com.microsoft.graph.models.extensions.User; |
32 | 32 | import com.microsoft.graph.requests.extensions.AttachmentCollectionPage; |
| 33 | +import com.microsoft.graph.requests.extensions.EventCollectionResponse; |
33 | 34 | import com.microsoft.graph.requests.extensions.AttachmentCollectionResponse; |
34 | 35 |
|
35 | 36 | public class CollectionPageSerializerTests { |
@@ -100,6 +101,14 @@ public void testEntityWithCollectionOfMultipleTypes() throws Exception { |
100 | 101 | assertTrue(page.get(0) instanceof User); |
101 | 102 | assertTrue(page.get(1) instanceof ServicePrincipal); |
102 | 103 | } |
| 104 | + @Test |
| 105 | + public void testEntityCollectionWithSingleValueExtendedProperties() throws Exception { |
| 106 | + final String jsonString = "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users('c2e8df37-c6a7-4d88-89b1-feb4f1fda7c5')/events\",\"@odata.nextLink\": \"https://graph.microsoft.com/v1.0/me/events?$skip=10\",\"value\": [{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#Me/messages/$entity\",\"@odata.id\": \"https://graph.microsoft.com/v1.0/users('ddfcd489-628b-40d7-b48b-57002df800e5@1717622f-1d94-4d0c-9d74-709fad664b77')/messages('AAMkAGE1M2_bs88AACHsLqWAAA=')\",\"@odata.etag\": \"W/\\\"CQAAABYAAACY4MQpaFz9SbqUDe4+bs88AACbyS4H\\\"\",\"id\": \"AAMkAGE1M2_bs88AACHsLqWAAA=\",\"subject\": \"RE: Talk about emergency prep\",\"sender\": {\"emailAddress\": {\"name\": \"Christine Irwin\",\"address\": \"[email protected]\"}},\"from\": null,\"toRecipients\": [{\"emailAddress\": {\"name\": \"Christine Irwin\",\"address\": \"[email protected]\"}}],\"[email protected]\": \"https://graph.microsoft.com/v1.0/$metadata#Me/messages('AAMkAGE1M2_bs88AACHsLqWAAA%3D')/singleValueExtendedProperties\",\"singleValueExtendedProperties\": [{\"id\": \"String {66f5a359-4659-4830-9070-00047ec6ac6e} Name Color\",\"value\": \"Green\"}]}]}"; |
| 107 | + final DefaultSerializer defaultSerializer = new DefaultSerializer(logger); |
| 108 | + final EventCollectionResponse events = defaultSerializer.deserializeObject(jsonString, EventCollectionResponse.class); |
| 109 | + assertNotNull(events); |
| 110 | + assertTrue(events.value.get(0).singleValueExtendedProperties.getCurrentPage().size() > 0); |
| 111 | + } |
103 | 112 |
|
104 | 113 | private FileAttachment getFileAttachment() throws Exception{ |
105 | 114 | FileAttachment fileAttachment = new FileAttachment(); |
|
0 commit comments