Currently I am trying to integrate JUnit5.3.0-RC1 into a Weld-SE-Testframework ejb-cdi-unit.
The first solution on JUnit5.2.0 available in ejb-cdi-unit:1.1.15 restricts the TestInstance-Classes somewhat concerning CDI. I can only allow @Inject. That helps already very much, but see
Now trying to implement the TestInstanceFactory, to avoid the mentioned restrictions, I encounter problems with example.
You can see a Testclass ServiceTest5 working in Lifecycle PER_CLASS and two nested inner classes of which one is working in Lifecycle PER_METHOD.
The innerclasses are currently disabled to avoid mails from travis-ci.
I would expect, that before the method ServiceTest5#WhenSomeEntitiesInDbExist#cantReadTestDataUsingServiceInRequiredNew is called, a completely new TestInstance of ServiceTest5 is created using the TestInstanceFactory implemented in JUnit5Extension, since the nested innerclass WhenSomeEntitiesInDbExist has Lifecycle PER_METHOD.
That is not the case. Is that by design, or a bug in the release candidate?