@Override
public void validate() throws ConfigurationException {
LOG.info("Validating configuration properties for email");
if (properties == null) {
throw new ConfigurationException("Properties can not be null");
}
if (properties.get("mail.smtp.host") == null) {
throw new ConfigurationException(
"Property mail.smtp.host is not given");
}
if (properties.get("mail.smtp.port") == null) {
throw new ConfigurationException(
"Property mail.smtp.port is not given");
}
if ("true".equals(properties.get("mail.smtp.auth"))) {
if (properties.get("username") == null) {
throw new ConfigurationException("Username is not given");
}
if (properties.get("password") == null) {
throw new ConfigurationException("Password is not given");
}
}
}