@Test public void suggestServerName_forSmtpServer() throws Exception { Type serverType = Type.SMTP; String domainPart = "example.org"; String result = serverNameSuggester.suggestServerName(serverType, domainPart); assertEquals("smtp.example.org", result); }
public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } throw new AssertionError("Missed case: " + serverType); }
ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } throw new AssertionError("Missed case: " + serverType); } }
ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } throw new AssertionError("Missed case: " + serverType); }  }
ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } throw new AssertionError("Missed case: " + serverType); }  String suggestServerName(Type serverType, String domainPart); }
ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } throw new AssertionError("Missed case: " + serverType); }  String suggestServerName(Type serverType, String domainPart);  }