Class TestConfigUtil


  • public final class TestConfigUtil
    extends Object
    • 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)
      • env

        public static Map<String,​String> env​(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.