package com.workfusion.odf.mail.impl.javax;

import java.util.List;

import org.junit.Ignore;
import org.junit.Test;

import com.workfusion.odf.service.mail.entity.EmailMessage;
import com.workfusion.odf.service.mail.impl.javax.ImapPop3EmailClient;

public class ImapPop3EmailClientTest {

    @Ignore
    @Test
    public void mtTest() throws Exception {
        String server = "https://outlook.office365.com/EWS/Exchange.asmx";
        String username = "rpa-coe-gf@workfusion.com";
        String password = "uX878eHV3AQtJBE";
            /*ImapPop3EmailClient client = new ImapPop3EmailClient(
                    ImapPop3EmailClient.SupportedProtocol.POP3,
                    "Outlook.office365.com",
                    "995",
                     username,
                    password,
                    true);*/
        ImapPop3EmailClient client = new ImapPop3EmailClient(
                ImapPop3EmailClient.SupportedProtocol.IMAP,
                "Outlook.office365.com",
                "993",
                username,
                password,
                true);
        List<EmailMessage> inbox = client.fetchUnreadMessages(false);
        inbox.forEach(msg -> client.copyMessage(msg, "Inbox/ABC"));
        // inbox.forEach(msg -> client.moveMessage(msg, "Inbox/QA_test"));


        System.out.println(inbox);
    }
}
