use of com.microsoft.graph.requests.MessageCollectionPage in project msgraph-sdk-java by microsoftgraph.
the class UserTests method meMessagesTest.
@Test
public void meMessagesTest() {
// GET me/messages
final MessageCollectionPage messageCollectionPage = graphServiceClient.me().messages().buildRequest().get();
assertNotNull(messageCollectionPage);
}
use of com.microsoft.graph.requests.MessageCollectionPage in project msgraph-sdk-java by microsoftgraph.
the class UserTests method mailFoldertest.
@Test
public void mailFoldertest() {
// GET me/mailFolders
final MailFolderCollectionPage mailFolderCollectionPage = graphServiceClient.me().mailFolders().buildRequest().get();
assertNotNull(mailFolderCollectionPage);
if (mailFolderCollectionPage.getCurrentPage().size() > 0) {
String mailFolderId = mailFolderCollectionPage.getCurrentPage().get(0).id;
final MessageCollectionPage messageCollectionPage = graphServiceClient.me().mailFolders(mailFolderId).messages().buildRequest().get();
assertNotNull(messageCollectionPage);
}
}
use of com.microsoft.graph.requests.MessageCollectionPage in project msgraph-beta-sdk-java by microsoftgraph.
the class UserTests method meMessagesTest.
@Test
public void meMessagesTest() {
// GET me/messages
final MessageCollectionPage messageCollectionPage = graphServiceClient.me().messages().buildRequest().get();
assertNotNull(messageCollectionPage);
}
use of com.microsoft.graph.requests.MessageCollectionPage in project msgraph-sdk-java by microsoftgraph.
the class OutlookTests method testSendDraft.
@Test
public void testSendDraft() {
TestBase testBase = new TestBase();
// Attempt to identify the sent message via randomly generated subject
String draftSubject = "Draft Test Message " + Double.toString(Math.random() * 1000);
Message newMessage = createDraftMessage(testBase, draftSubject);
// Send the drafted message
testBase.graphClient.me().mailFolders("Drafts").messages(newMessage.id).send().buildRequest().post();
// Check that the sent message exists on the server
MessageCollectionPage mcp = testBase.graphClient.me().messages().buildRequest().filter("subject eq '" + draftSubject + "'").get();
assertFalse(mcp.getCurrentPage().isEmpty());
}
use of com.microsoft.graph.requests.MessageCollectionPage in project msgraph-beta-sdk-java by microsoftgraph.
the class OutlookTests method testSendDraft.
@Test
public void testSendDraft() {
TestBase testBase = new TestBase();
// Attempt to identify the sent message via randomly generated subject
String draftSubject = "Draft Test Message " + Double.toString(Math.random() * 1000);
Message newMessage = createDraftMessage(testBase, draftSubject);
// Send the drafted message
testBase.graphClient.me().mailFolders("Drafts").messages(newMessage.id).send().buildRequest().post();
// Check that the sent message exists on the server
MessageCollectionPage mcp = testBase.graphClient.me().messages().buildRequest().filter("subject eq '" + draftSubject + "'").get();
assertFalse(mcp.getCurrentPage().isEmpty());
}
Aggregations