PolicyNotificationMail { @Bean public JavaMailSenderImpl javaMailSenderImpl() { JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); mailSender.setHost(PolicyController.getSmtpHost()); mailSender.setPort(Integer.parseInt(PolicyController.getSmtpPort())); mailSender.setUsername(PolicyController.getSmtpUsername()); mailSender.setPassword(PolicyController.getSmtpPassword()); Properties prop = mailSender.getJavaMailProperties(); prop.put("mail.transport.protocol", "smtp"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.starttls.enable", "true"); prop.put("mail.debug", "true"); return mailSender; }  @Bean JavaMailSenderImpl javaMailSenderImpl(); void sendMail(PolicyVersion entityItem, String policyName, String mode,
            CommonClassDao policyNotificationDao);  }
@Test public final void testJavaMailSenderImpl() { PolicyNotificationMail notificationMail = new PolicyNotificationMail(); try { assertTrue(notificationMail.javaMailSenderImpl() != null); } catch (Exception e) { fail(); } }