Package io.quarkus.test.common
Class TestConfigUtil
- java.lang.Object
-
- io.quarkus.test.common.TestConfigUtil
-
public final class TestConfigUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_WAIT_TIME_SECONDS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>argLineValue(org.eclipse.microprofile.config.Config config)static voidcleanUp()Clean up config left over from badly-behaving previous tests.static Map<String,String>env(org.eclipse.microprofile.config.Config config)static StringintegrationTestProfile(org.eclipse.microprofile.config.Config config)static StringrunTarget(org.eclipse.microprofile.config.Config config)static DurationwaitTimeValue(org.eclipse.microprofile.config.Config config)
-
-
-
Field Detail
-
DEFAULT_WAIT_TIME_SECONDS
public static final long DEFAULT_WAIT_TIME_SECONDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
argLineValue
public static List<String> argLineValue(org.eclipse.microprofile.config.Config config)
-
waitTimeValue
public static Duration waitTimeValue(org.eclipse.microprofile.config.Config config)
-
integrationTestProfile
public static String integrationTestProfile(org.eclipse.microprofile.config.Config config)
-
runTarget
public static String runTarget(org.eclipse.microprofile.config.Config config)
-
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.
-
-