use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapAllExtras.
@Test
public void testDecodeStoreUriImapAllExtras() {
String uri = "imap://PLAIN:user:pass@server:143/0%7CcustomPathPrefix";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(AuthType.PLAIN, settings.authenticationType);
assertEquals("user", settings.username);
assertEquals("pass", settings.password);
assertEquals("server", settings.host);
assertEquals(143, settings.port);
assertEquals("false", settings.getExtra().get("autoDetectNamespace"));
assertEquals("customPathPrefix", settings.getExtra().get("pathPrefix"));
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testCreateStoreUriImapAutoDetectNamespace.
@Test
public void testCreateStoreUriImapAutoDetectNamespace() {
Map<String, String> extra = new HashMap<String, String>();
extra.put("autoDetectNamespace", "true");
ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143, ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null, extra);
String uri = RemoteStore.createStoreUri(settings);
assertEquals("imap://PLAIN:user:pass@server:143/1%7C", uri);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapXOAuth2.
@Test
public void testDecodeStoreUriImapXOAuth2() {
String uri = "imap://XOAUTH2:user:@server/";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(AuthType.XOAUTH2, settings.authenticationType);
assertEquals("user", settings.username);
assertEquals(null, settings.password);
assertEquals(null, settings.clientCertificateAlias);
assertEquals("server", settings.host);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapSSL.
@Test
public void testDecodeStoreUriImapSSL() {
String uri = "imap+tls+://PLAIN:user:pass@server/";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(ConnectionSecurity.STARTTLS_REQUIRED, settings.connectionSecurity);
assertEquals(AuthType.PLAIN, settings.authenticationType);
assertEquals("user", settings.username);
assertEquals("pass", settings.password);
assertEquals("server", settings.host);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapAutodetectAndPrefix.
@Test
public void testDecodeStoreUriImapAutodetectAndPrefix() {
String uri = "imap://PLAIN:user:pass@server:143/1%7CcustomPathPrefix";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(AuthType.PLAIN, settings.authenticationType);
assertEquals("user", settings.username);
assertEquals("pass", settings.password);
assertEquals("server", settings.host);
assertEquals(143, settings.port);
assertEquals("true", settings.getExtra().get("autoDetectNamespace"));
assertNull(settings.getExtra().get("pathPrefix"));
}
Aggregations