### Question:
SettingServiceImpl extends RemoteServiceServlet implements SettingService { @Override public void saveEmailSettings(GUIEmailSettings settings) throws ServerException { Session session = ServiceUtil.checkMenu(getThreadLocalRequest(), Menu.SETTINGS); try { ContextProperties conf = Context.get().getProperties(); conf.setProperty(session.getTenantName() + ".smtp.host", settings.getSmtpServer()); conf.setProperty(session.getTenantName() + ".smtp.port", Integer.toString(settings.getPort())); conf.setProperty(session.getTenantName() + ".smtp.username", !settings.getUsername().trim().isEmpty() ? settings.getUsername() : ""); conf.setProperty(session.getTenantName() + ".smtp.password", !settings.getPwd().trim().isEmpty() ? settings.getPwd() : ""); conf.setProperty(session.getTenantName() + ".smtp.connectionSecurity", settings.getConnSecurity()); conf.setProperty(session.getTenantName() + ".smtp.authEncripted", settings.isSecureAuth() ? "true" : "false"); conf.setProperty(session.getTenantName() + ".smtp.sender", settings.getSenderEmail()); conf.setProperty(session.getTenantName() + ".smtp.userasfrom", "" + settings.isUserAsFrom()); conf.write(); EMailSender sender = (EMailSender) Context.get().getBean(EMailSender.class); sender.setHost(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.host")); sender.setPort(Integer.parseInt(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.port"))); sender.setUsername(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.username")); sender.setPassword(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.password")); sender.setSender(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.sender")); sender.setAuthEncripted( "true".equals(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.authEncripted")) ? true : false); sender.setConnectionSecurity( Integer.parseInt(conf.getProperty(Tenant.DEFAULT_NAME + ".smtp.connectionSecurity"))); log.info("Email settings data written successfully."); } catch (Exception e) { log.error("Exception writing Email settings data: {}", e.getMessage(), e); } }  @Override GUIEmailSettings loadEmailSettings(); @Override void saveEmailSettings(GUIEmailSettings settings); @Override GUIParameter[] loadSettings(); @Override GUIParameter[] loadClientSettings(); @Override void saveSettings(GUIParameter[] settings); @Override void saveStorageSettings(GUIParameter[] settings); @Override GUIParameter[] loadSettingsByNames(String[] names); @Override GUIParameter[] loadGUISettings(); @Override boolean testEmail(String email); @Override boolean testStorage(int id); @Override void saveRegistration(String name, String email, String organization, String website); @Override GUIParameter[] loadConverterParameters(String converter); @Override void saveExtensionAliases(String extension, String aliases);  }### Answer:
@Test public void testSaveEmailSettings() throws ServerException { GUIEmailSettings emailSettings = new GUIEmailSettings(); emailSettings.setSmtpServer("smtp.logicalobjects.it"); emailSettings.setPort(8080); emailSettings.setUsername("admin"); emailSettings.setPwd("pippo"); emailSettings.setConnSecurity(GUIEmailSettings.SECURITY_TLS); emailSettings.setSecureAuth(true); emailSettings.setSenderEmail("mario@acme.com"); service.saveEmailSettings(emailSettings); }