BackupImapStore extends ImapStore { TrustedSocketFactory getTrustedSocketFactory() { return mTrustedSocketFactory; } BackupImapStore(final Context context, final String uri,
                           boolean trustAllCertificates); BackupFolder getFolder(DataType type, DataTypePreferences preferences); void closeFolders(); @Override String toString(); String getStoreUriForLogging(); String getStoreUri(); static boolean isValidImapFolder(String imapFolder); static boolean isValidUri(String uri);  }
@Test public void testShouldCreateCorrectTrustFactoryForTrustedSSLUrl() throws Exception { String uri = "imap+ssl+: BackupImapStore store = new BackupImapStore(RuntimeEnvironment.application, uri, false); assertThat(store.getTrustedSocketFactory()).isInstanceOf(DefaultTrustedSocketFactory.class); }
@Test public void testShouldCreateCorrectTrustFactoryForTrustAllSSLUrl() throws Exception { String uri = "imap+ssl: BackupImapStore store = new BackupImapStore(RuntimeEnvironment.application, uri, true); assertThat(store.getTrustedSocketFactory()).isInstanceOf(AllTrustedSocketFactory.class); }
@Test public void testShouldCreateCorrectTrustFactoryForTrustedTLSUrl() throws Exception { String uri = "imap+tls+: BackupImapStore store = new BackupImapStore(RuntimeEnvironment.application, uri, false); assertThat(store.getTrustedSocketFactory()).isInstanceOf(DefaultTrustedSocketFactory.class); }