Search in sources :

Example 1 with TestTrustedSocketFactory

use of com.fsck.k9.mail.helpers.TestTrustedSocketFactory in project k-9 by k9mail.

the class ImapConnectionTest method setUp.

@Before
public void setUp() throws Exception {
    connectivityManager = mock(ConnectivityManager.class);
    oAuth2TokenProvider = mock(OAuth2TokenProvider.class);
    socketFactory = new TestTrustedSocketFactory();
    settings = new SimpleImapSettings();
    settings.setUsername(USERNAME);
    settings.setPassword(PASSWORD);
    if (DEBUGGING) {
        ShadowLog.stream = System.out;
        K9MailLib.setDebug(true);
        K9MailLib.setDebugSensitive(true);
    }
}
Also used : ConnectivityManager(android.net.ConnectivityManager) OAuth2TokenProvider(com.fsck.k9.mail.oauth.OAuth2TokenProvider) TestTrustedSocketFactory(com.fsck.k9.mail.helpers.TestTrustedSocketFactory) Before(org.junit.Before)

Example 2 with TestTrustedSocketFactory

use of com.fsck.k9.mail.helpers.TestTrustedSocketFactory in project k-9 by k9mail.

the class SmtpTransportTest method before.

@Before
public void before() throws AuthenticationFailedException {
    socketFactory = new TestTrustedSocketFactory();
    oAuth2TokenProvider = mock(OAuth2TokenProvider.class);
    when(oAuth2TokenProvider.getToken(eq(USERNAME), anyInt())).thenReturn("oldToken").thenReturn("newToken");
}
Also used : OAuth2TokenProvider(com.fsck.k9.mail.oauth.OAuth2TokenProvider) TestTrustedSocketFactory(com.fsck.k9.mail.helpers.TestTrustedSocketFactory) Before(org.junit.Before)

Aggregations

TestTrustedSocketFactory (com.fsck.k9.mail.helpers.TestTrustedSocketFactory)2 OAuth2TokenProvider (com.fsck.k9.mail.oauth.OAuth2TokenProvider)2 Before (org.junit.Before)2 ConnectivityManager (android.net.ConnectivityManager)1