Created
September 28, 2015 16:48
-
-
Save stephan-mueller/7ca320fd85396cbcd4bb to your computer and use it in GitHub Desktop.
Arquillian test for the cdi service alternative {@link AlternativeMailService}.
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
@RunWith(Arquillian.class) | |
public class AlternativeMailServiceIT { | |
private static final Logger LOG = LoggerFactory.getLogger(AlternativeMailServiceIT.class); | |
@Deployment | |
public static Archive createDeployment() { | |
PomEquippedResolveStage pomFile = Maven.resolver().loadPomFromFile("pom.xml"); | |
WebArchive archive = ShrinkWrap.create(WebArchive.class) | |
.addAsLibraries(pomFile.resolve("org.assertj:assertj-core").withTransitivity().asFile()) | |
.addClasses(MailService.class, AlternativeMailService.class) | |
.addAsWebInfResource("test-beans.xml", "beans.xml");; | |
LOG.debug(archive.toString(true)); | |
return archive; | |
} | |
@Inject | |
private MailService service; | |
@Test | |
public void sendMail() throws Exception { | |
AlternativeMailService.latch = new CountDownLatch(1); | |
service.sendMail("Testmail", "Das ist ein Test", "max.mustermann@openknowledge.de"); | |
assertThat(AlternativeMailService.latch.await(2, TimeUnit.SECONDS)).isTrue(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment