test dwc mailbox

This commit is contained in:
Ralph Soika 2024-06-18 10:55:54 +02:00
parent d4da6a5869
commit 865d87a80e

View file

@ -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 * This method returns a connection to an javax.mail.store
*/ */