Created
September 28, 2015 16:49
-
-
Save stephan-mueller/d8b4c23cdbfab187ce0e to your computer and use it in GitHub Desktop.
Arquillian test for the cdi service specializes {@link SpecializedMailService}.
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 SpecializedMailServiceIT { | |
private static final Logger LOG = LoggerFactory.getLogger(SpecializedMailServiceIT.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, SpecializedMailService.class) | |
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); | |
LOG.debug(archive.toString(true)); | |
return archive; | |
} | |
@Inject | |
private MailService service; | |
@Test | |
public void sendMail() throws Exception { | |
SpecializedMailService.latch = new CountDownLatch(1); | |
service.sendMail("Testmail", "Das ist ein Test", "max.mustermann@openknowledge.de"); | |
assertThat(SpecializedMailService.latch.await(2, TimeUnit.SECONDS)).isTrue(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment