Search in sources :

Example 81 with MockImapServer

use of com.fsck.k9.mail.store.imap.mockserver.MockImapServer in project k-9 by k9mail.

the class RealImapConnectionTest method open_authPlainWithoutAuthPlainCapability_shouldUseLoginMethod.

@Test
public void open_authPlainWithoutAuthPlainCapability_shouldUseLoginMethod() throws Exception {
    settings.setAuthType(AuthType.PLAIN);
    MockImapServer server = new MockImapServer();
    preAuthenticationDialog(server);
    server.expect("2 LOGIN \"" + USERNAME + "\" \"" + PASSWORD + "\"");
    server.output("2 OK LOGIN completed");
    postAuthenticationDialogRequestingCapabilities(server);
    ImapConnection imapConnection = startServerAndCreateImapConnection(server);
    imapConnection.open();
    server.verifyConnectionStillOpen();
    server.verifyInteractionCompleted();
}
Also used : MockImapServer(com.fsck.k9.mail.store.imap.mockserver.MockImapServer) XOAuth2ChallengeParserTest(com.fsck.k9.mail.XOAuth2ChallengeParserTest) Test(org.junit.Test)

Aggregations

XOAuth2ChallengeParserTest (com.fsck.k9.mail.XOAuth2ChallengeParserTest)81 MockImapServer (com.fsck.k9.mail.store.imap.mockserver.MockImapServer)81 Test (org.junit.Test)81 AuthenticationFailedException (com.fsck.k9.mail.AuthenticationFailedException)10 CertificateValidationException (com.fsck.k9.mail.CertificateValidationException)6 MessagingException (com.fsck.k9.mail.MessagingException)4 IOException (java.io.IOException)4 InOrder (org.mockito.InOrder)3