test dwc mailbox
This commit is contained in:
parent
d4da6a5869
commit
865d87a80e
1 changed files with 33 additions and 0 deletions
|
|
@ -115,6 +115,39 @@ public class TestIMAPOutlookOAuth {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestMailboxImixsDWC() {
|
||||
Store store = null;
|
||||
String token = null;
|
||||
try {
|
||||
// try to connect...
|
||||
// token = getAuthToken("2a41bf2d-ffd8-444d-a2c5-6a4a418650ba");
|
||||
token = getAuthToken();
|
||||
Assert.assertNotNull(token);
|
||||
store = connect(token, "Imixsae@alexander-logistics.com");
|
||||
|
||||
Assert.assertNotNull(store);
|
||||
|
||||
if (!store.isConnected()) {
|
||||
// not connected!
|
||||
} else {
|
||||
// read inbox....
|
||||
IMAPFolder inbox = (IMAPFolder) store.getFolder("INBOX");
|
||||
inbox.open(Folder.READ_WRITE);
|
||||
// fetches all messages from the INBOX...
|
||||
Message[] messages = inbox.getMessages();
|
||||
System.out.println("..." + messages.length + " new messages found");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Assert.fail();
|
||||
} catch (MessagingException e) {
|
||||
e.printStackTrace();
|
||||
Assert.fail();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a connection to an javax.mail.store
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue