use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class SmtpTransportUriTest method decodeUri_canDecodeTLS.
@Test
public void decodeUri_canDecodeTLS() {
String storeUri = "smtp+tls+://user:password:PLAIN@server:123456";
ServerSettings result = SmtpTransport.decodeUri(storeUri);
assertEquals(ConnectionSecurity.STARTTLS_REQUIRED, result.connectionSecurity);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class SmtpTransportUriTest method createUri_canEncodeSmtpSslUri.
@Test
public void createUri_canEncodeSmtpSslUri() {
ServerSettings serverSettings = new ServerSettings(ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.EXTERNAL, "user", "password", "clientCert");
String result = SmtpTransport.createUri(serverSettings);
assertEquals("smtp+ssl+://user:clientCert:EXTERNAL@server:123456", result);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class SmtpTransportUriTest method createUri_canEncodeSmtpTlsUri.
@Test
public void createUri_canEncodeSmtpTlsUri() {
ServerSettings serverSettings = new ServerSettings(ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.STARTTLS_REQUIRED, AuthType.PLAIN, "user", "password", "clientCert");
String result = SmtpTransport.createUri(serverSettings);
assertEquals("smtp+tls+://user:password:PLAIN@server:123456", result);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testCreateStoreUriImapPrefix.
@Test
public void testCreateStoreUriImapPrefix() {
Map<String, String> extra = new HashMap<String, String>();
extra.put("autoDetectNamespace", "false");
extra.put("pathPrefix", "customPathPrefix");
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%7CcustomPathPrefix", uri);
}
use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.
the class ImapStoreUriTest method testDecodeStoreUriImapNoExtras.
@Test
public void testDecodeStoreUriImapNoExtras() {
String uri = "imap://PLAIN:user:pass@server:143/";
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"));
}
Aggregations