Definitely sounds like a case for the ShrinkWrap Resolver Maven Importer (not to be confused with the Maven Resolver). Here are some tests showing its use.
I have a separate sample only for the case of the Gradle Importer (I know that you are using maven), but the test design is similar here .
I don't have an exact example publicly available with both @RunAsClient and Maven Importer, but I have a project that uses them with Graphene , and this combination works :). Typically, the test should look like this:
@RunWith(Arquillian.class) public class SomeControllerIT { @Deployment public static WebArchive createDeployment() { return ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput() .as(WebArchive.class); } @Test @RunAsClient public void shouldDoSth() throws Exception { ... } }
Why use Maven Importer instead of launching a war? The war is created after the tests are completed, which means that if the war exists during the test, it comes from the previous assembly and is outdated.
source share