Is there a way to have complete control over the execution of test methods (including before / after methods) in JUnit5, similar to the JUnit4 @RunWith annotation)?
I am trying to build a JUnit5 Arquillian extension, but since Aquillian basically needs to run every test in the container, I am having trouble starting Arquillian from the Junit5 extension.
My code is here: BasicJunit5ArquillianTest.java
The test should run all methods (including before / after) in a separate container, which can be a separate JVM, a remote or embedded server, or something isolated. My extension launches a test method from beforeEach hook, using Arquillian to transfer the test class and run it in the container using LauncherFactory.create () , collect test results and pass them back.
The problem is that the test methods are executed twice - through normal JUnit5 execution and through my Arquillian extension from the beforeEach hook. I would like to run tests only through Arquillian and skip the normal execution of methods.
Is this possible in the JUnit5 extension? Or do I need to create my own test engine, possibly expanding the Jupiter test engine?
source
share