diff --git a/node/build.gradle b/node/build.gradle index d942b3bbb8..4759f663f9 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -330,7 +330,6 @@ jar { tasks.named('test', Test) { maxHeapSize = "3g" maxParallelForks = (System.env.CORDA_NODE_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_NODE_TESTING_FORKS".toInteger() - jvmArgs(['--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED', '--add-opens', 'java.base/java.util=ALL-UNNAMED']) } publishing { diff --git a/node/src/test/kotlin/net/corda/node/services/config/ConfigHelperTests.kt b/node/src/test/kotlin/net/corda/node/services/config/ConfigHelperTests.kt index 24d19a2209..11d77da6aa 100644 --- a/node/src/test/kotlin/net/corda/node/services/config/ConfigHelperTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/config/ConfigHelperTests.kt @@ -68,17 +68,16 @@ class ConfigHelperTests { @Test(timeout = 300_000) fun `bad keys are ignored and warned for`() { - val outContent = ByteArrayOutputStream() - val errContent = ByteArrayOutputStream() val originalOut = System.out - val originalErr = System.err - System.setOut(PrintStream(outContent)); - System.setErr(PrintStream(errContent)); - val config = loadConfig("corda_bad_key" to "2077") - assertTrue(outContent.toString().contains("(property or environment variable) cannot be mapped to an existing Corda")) - assertFalse(config?.hasPath("corda_bad_key") ?: true) - System.setOut(originalOut); - System.setErr(originalErr); + try { + val outContent = ByteArrayOutputStream() + System.setOut(PrintStream(outContent)); + val config = loadConfig("corda_bad_key" to "2077") + assertTrue(outContent.toString().contains("(property or environment variable) cannot be mapped to an existing Corda")) + assertFalse(config?.hasPath("corda_bad_key") ?: true) + } finally { + System.setOut(originalOut); + } } /**