when running the mail-test from eclipse (junit), it passes and sends the email. but when running it from maven (mvn install), it invokes the mvn-surefire-plugin and fails:
java.lang.AssertionError: null
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1578)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:248)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:306)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:296)
at com.ohadr.auth_flows.core.TestMailSender.test(TestMailSender.java:32)
when running the mail-test from eclipse (junit), it passes and sends the email. but when running it from maven (mvn install), it invokes the mvn-surefire-plugin and fails:
java.lang.AssertionError: null at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1578) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412) at javax.mail.Service.connect(Service.java:248) at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:306) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:296) at com.ohadr.auth_flows.core.TestMailSender.test(TestMailSender.java:32)
the fix: https://confluence.atlassian.com/display/JIRAKB/java.lang.AssertionError+When+Sending+Mail+Via+SMTP http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html disable assertions from surefire-plugin.