We have examples of what you are trying to do in the Quarkus Superheroes Sample application: https://github.com/quarkusio/quarkus-super-heroes
Specifically this service layer: https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-heroes/src/main/java/io/quarkus/sample/superheroes/hero/service/HeroService.java
And these tests: https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-heroes/src/test/java/io/quarkus/sample/superheroes/hero/service/HeroServiceTests.java
I think they key is https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-heroes/src/test/java/io/quarkus/sample/superheroes/hero/service/HeroServiceTests.java - Injecting a mock of your repository (or using PanacheMock
if you are using the active record pattern.
If you are using the "real" database in your tests then yes you will need @TestReactiveTransaction
, like in https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-heroes/src/test/java/io/quarkus/sample/superheroes/hero/repository/HeroRepositoryTests.java