Package io.quarkus.test.common
Class TestConfigUtil
java.lang.Object
io.quarkus.test.common.TestConfigUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionargLineValue
(org.eclipse.microprofile.config.Config config) static void
cleanUp()
Clean up config left over from badly-behaving previous tests.env
(org.eclipse.microprofile.config.Config config) static String
integrationTestProfile
(org.eclipse.microprofile.config.Config config) static String
runTarget
(org.eclipse.microprofile.config.Config config) static Duration
waitTimeValue
(org.eclipse.microprofile.config.Config config)
-
Field Details
-
DEFAULT_WAIT_TIME_SECONDS
public static final long DEFAULT_WAIT_TIME_SECONDS- See Also:
-
-
Method Details
-
argLineValue
-
env
-
waitTimeValue
-
integrationTestProfile
-
runTarget
-
cleanUp
public static void cleanUp()Clean up config left over from badly-behaving previous tests.Tests may call ConfigProvider.getConfig() directly or indirectly, triggering lazy initialization in QuarkusConfigFactory#getConfigFor, and if they don't call QuarkusConfigFactory.setConfig(null) afterward, they may leak that config. As it's quite hard to guarantee that all tests clean up after them, especially if they don't use any Quarkus*Test extensions, we call this cleanup here in Quarkus*Test extensions as an additional safeguard.
Note this must be called quite early in extensions in order to be effective: things like TestHTTPResourceManager#getUri make use of config and may be called very early, upon test instantiation, so cleaning up in beforeEach() won't cut it for example.
-