Sbert
Sbert

Reputation: 3

How to use H2 in test with PanacheEntity without ContextNotActive error

I'm trying to use H2 in test with PanacheEntity, but I have an error when I initiate the data in the test.

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.013 s <<< FAILURE! - in org.acme.config.PersonResourceTest
[ERROR] org.acme.config.PersonResourceTest  Time elapsed: 0.013 s  <<< ERROR!
javax.enterprise.context.ContextNotActiveException: 
at org.acme.config.PersonResourceTest.init(PersonResourceTest.java:34)

The source code : https://github.com/sbert/test-quarkus

If I use a service to init the data and inject it in the test everything is ok. But it can't be a solution

Upvotes: 0

Views: 417

Answers (1)

Guillaume Smet
Guillaume Smet

Reputation: 10549

It has been fixed in the upcoming Quarkus 0.13.0 that should be released tonigh, April 4th.

See this issue: https://github.com/quarkusio/quarkus/issues/1367 .

Upvotes: 1

Related Questions