Created
October 6, 2013 17:40
-
-
Save willemsst/6856887 to your computer and use it in GitHub Desktop.
akka james-smtp camel actor spock test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.idevelop.opencom.smtp.server.actor | |
import akka.actor.ActorSystem | |
import org.apache.commons.mail.SimpleEmail | |
import spock.lang.Shared | |
import spock.lang.Specification | |
class SmtpActorTest extends Specification { | |
@Shared | |
ActorSystem system | |
def setupSpec() { | |
system = ActorSystem.create("SMTP-unit-test") | |
system.actorOf(SmtpActor.create(system)) | |
} | |
def cleanupSpec() { | |
system.shutdown() | |
} | |
def 'test send and receive real email'() { | |
given: | |
SimpleEmail email = new SimpleEmail() | |
email.setHostName('localhost') | |
email.setDebug(true) | |
email.setSmtpPort(25052) | |
email.setFrom('steven@opencom.io') | |
email.addTo('receiver@opencom.io') | |
email.setMsg('Test message') | |
when: | |
email.send() | |
then: | |
notThrown(Exception.class) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment