samedi 16 janvier 2021

How to get Quarkus multimodule CDI working in tests?

In Quarkus testing one can normally easily use beans by annotating them with @Inject:

@QuarkusTest
class InjectionTest {

@Inject
SomeBean someBean;

@Test
void someTest() {
     // Testing logic, assertions and all
}

Unfortunately this results in an error when using a multiple modular setup. An example project for such a setup can be found here: https://github.com/lssoares/multi-maven-quarkus To reproduce, just try to inject any bean into any of the tests.

Aucun commentaire:

Enregistrer un commentaire