use of com.microsoft.graph.requests.AttachmentCollectionPage in project msgraph-sdk-java by microsoftgraph.
the class OutlookTests method sendEmailWithAttachment.
@Test
public void sendEmailWithAttachment() throws Exception {
TestBase testBase = new TestBase();
Message message = getMessage();
message.hasAttachments = true;
AttachmentCollectionResponse response = new AttachmentCollectionResponse();
response.value = Arrays.asList(getFileAttachment(), getItemAttachmentWithEvent(), getItemAttachmentWithContact());
message.attachments = new AttachmentCollectionPage(response, null);
testBase.graphClient.me().sendMail(UserSendMailParameterSet.newBuilder().withMessage(message).withSaveToSentItems(true).build()).buildRequest().post();
}
use of com.microsoft.graph.requests.AttachmentCollectionPage in project msgraph-beta-sdk-java by microsoftgraph.
the class OutlookTests method sendEmailWithAttachment.
@Test
public void sendEmailWithAttachment() throws Exception {
TestBase testBase = new TestBase();
Message message = getMessage();
message.hasAttachments = true;
AttachmentCollectionResponse response = new AttachmentCollectionResponse();
response.value = Arrays.asList(getFileAttachment(), getItemAttachmentWithEvent(), getItemAttachmentWithContact());
message.attachments = new AttachmentCollectionPage(response, null);
testBase.graphClient.me().sendMail(UserSendMailParameterSet.newBuilder().withMessage(message).withSaveToSentItems(true).build()).buildRequest().post();
}
use of com.microsoft.graph.requests.AttachmentCollectionPage in project msgraph-beta-sdk-java by microsoftgraph.
the class OutlookTests method sendEventWithAttachment.
@Test
public void sendEventWithAttachment() throws Exception {
TestBase testBase = new TestBase();
Event event = getEvent();
event.body = getItemBody();
event.hasAttachments = true;
AttachmentCollectionResponse response = new AttachmentCollectionResponse();
response.value = Arrays.asList(getFileAttachment(), getItemAttachmentWithContact());
event.attachments = new AttachmentCollectionPage(response, null);
Event eventResponse = testBase.graphClient.me().events().buildRequest().post(event);
assertNotNull(eventResponse);
}
Aggregations