### Question:
TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentException("Not a valid transport URI"); } }  static ServerSettings decodeTransportUri(String uri); static String createTransportUri(ServerSettings server);  }### Answer:
@Test public void createTransportUri_canEncodeSmtpSslUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.EXTERNAL, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assertEquals("smtp+ssl+: }
@Test public void createTransportUri_canEncodeSmtpTlsUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.STARTTLS_REQUIRED, AuthType.PLAIN, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assertEquals("smtp+tls+: }
@Test public void createTransportUri_canEncodeSmtpUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.NONE, AuthType.CRAM_MD5, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assertEquals("smtp: }