use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapTLS.
@Test
public void testDecodeStoreUriImapTLS() {
String uri = "imap+ssl+://PLAIN:user:pass@server/";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(ConnectionSecurity.SSL_TLS_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 testDecodeStoreUriImapNoAuth.
@Test
public void testDecodeStoreUriImapNoAuth() {
String uri = "imap://user:pass@server/";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
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 testDecodeStoreUriImapNoPassword.
@Test
public void testDecodeStoreUriImapNoPassword() {
String uri = "imap://user:@server/";
ServerSettings settings = RemoteStore.decodeStoreUri(uri);
assertEquals(AuthType.PLAIN, settings.authenticationType);
assertEquals("user", settings.username);
assertEquals(null, settings.password);
assertEquals("server", settings.host);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testCreateStoreUriImapNoExtra.
@Test
public void testCreateStoreUriImapNoExtra() {
ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143, ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null);
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 testCreateStoreUriImapEmptyPrefix.
@Test
public void testCreateStoreUriImapEmptyPrefix() {
Map<String, String> extra = new HashMap<String, String>();
extra.put("autoDetectNamespace", "false");
extra.put("pathPrefix", "");
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/0%7C", uri);
}
Aggregations