@Test public void getDefaultPort_withTlsAndImap_shouldReturnDefaultTlsPort() { int result = AccountCreator.getDefaultPort(ConnectionSecurity.SSL_TLS_REQUIRED, Type.IMAP); assertEquals(Type.IMAP.defaultTlsPort, result); }
public static int getDefaultPort(ConnectionSecurity securityType, Type storeType) { switch (securityType) { case NONE: case STARTTLS_REQUIRED: { return storeType.defaultPort; } case SSL_TLS_REQUIRED: { return storeType.defaultTlsPort; } } throw new AssertionError("Unhandled ConnectionSecurity type encountered: " + securityType); }
AccountCreator { public static int getDefaultPort(ConnectionSecurity securityType, Type storeType) { switch (securityType) { case NONE: case STARTTLS_REQUIRED: { return storeType.defaultPort; } case SSL_TLS_REQUIRED: { return storeType.defaultTlsPort; } } throw new AssertionError("Unhandled ConnectionSecurity type encountered: " + securityType); } }
AccountCreator { public static int getDefaultPort(ConnectionSecurity securityType, Type storeType) { switch (securityType) { case NONE: case STARTTLS_REQUIRED: { return storeType.defaultPort; } case SSL_TLS_REQUIRED: { return storeType.defaultTlsPort; } } throw new AssertionError("Unhandled ConnectionSecurity type encountered: " + securityType); }  }
AccountCreator { public static int getDefaultPort(ConnectionSecurity securityType, Type storeType) { switch (securityType) { case NONE: case STARTTLS_REQUIRED: { return storeType.defaultPort; } case SSL_TLS_REQUIRED: { return storeType.defaultTlsPort; } } throw new AssertionError("Unhandled ConnectionSecurity type encountered: " + securityType); }  static DeletePolicy getDefaultDeletePolicy(Type type); static int getDefaultPort(ConnectionSecurity securityType, Type storeType); }
AccountCreator { public static int getDefaultPort(ConnectionSecurity securityType, Type storeType) { switch (securityType) { case NONE: case STARTTLS_REQUIRED: { return storeType.defaultPort; } case SSL_TLS_REQUIRED: { return storeType.defaultTlsPort; } } throw new AssertionError("Unhandled ConnectionSecurity type encountered: " + securityType); }  static DeletePolicy getDefaultDeletePolicy(Type type); static int getDefaultPort(ConnectionSecurity securityType, Type storeType);  }