-
-
Save anonymous/7172035c42c4d0866953 to your computer and use it in GitHub Desktop.
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 MyTest { | |
@Deployment | |
public static WebArchive createDeployment() { | |
PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml"); | |
BeansDescriptor beansXml = Descriptors.create(BeansDescriptor.class).addDefaultNamespaces().getOrCreateAlternatives() | |
.stereotype(Mock.class.getName()).up(); | |
return ShrinkWrap.create(WebArchive.class).addAsLibrary(pom.resolve("org.mockito:mockito-core").withTransitivity().asfile())) | |
.addClasses(MyComponentToTest.class, MyDependency.class).addClasses(Mocks.class, Mock.class) | |
.addAsWebInfResource(beansXml.exportAsString(), "beans.xml"); | |
} | |
@inject | |
private MyDependency myDependency; | |
@inject | |
private MyComponentToTest myComponent; | |
@test | |
public void myComponentTest() { | |
... | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment