'Quarkus : How to disable/mock Vault for unit testing

I'm currently facing an issue with Quarkus and Vault.

When I launch JUnit tests, Vault trying to start and it failed because Vault configuration is not setup to run locally.

Caused by: java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:912)
at io.quarkus.runtime.Application.start(Application.java:101)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.NullPointerException
at io.quarkus.vault.runtime.config.VaultConfigSource.getSecretConfig(VaultConfigSource.java:78)
at io.quarkus.vault.runtime.config.VaultConfigSource.getValue(VaultConfigSource.java:59)

My question is, is there a way to disable Vault during Junit tests on Quarkus like on SpringBoot (with property) ? Or create Vault Mock which can be used locally ?

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source