From 4db2447e0b33d130532e2167ff4758167d9d5a33 Mon Sep 17 00:00:00 2001 From: josecoll Date: Tue, 14 May 2019 18:31:53 +0100 Subject: [PATCH] Fixed JUnit to not use a deprecated/removed JDK package "com.sun.xml.internal.messaging.saaj". --- .../services/network/DBNetworkParametersStorageTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt index 30ae1e4bff..57b440f9e1 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt @@ -4,7 +4,6 @@ import com.nhaarman.mockito_kotlin.any import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.verify -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream import net.corda.core.crypto.SecureHash import net.corda.core.internal.SignedDataWithCert import net.corda.core.node.NetworkParameters @@ -26,6 +25,7 @@ import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test +import java.io.ByteArrayOutputStream import java.io.PrintStream import kotlin.streams.toList @@ -100,6 +100,7 @@ class DBNetworkParametersStorageTest { database.transaction { val consoleOutput = interceptConsoleOutput { networkParametersService.lookup(hash3) + System.out.println() } assertThat(consoleOutput).anySatisfy { it.contains("Caused by: java.security.cert.CertPathValidatorException: subject/issuer name chaining check failed") @@ -109,11 +110,11 @@ class DBNetworkParametersStorageTest { private fun interceptConsoleOutput(block: () -> Unit): List { val oldOut = System.out - val out = ByteOutputStream() + val out = ByteArrayOutputStream() System.setOut(PrintStream(out)) block() System.setOut(oldOut) - return out.bytes.inputStream().bufferedReader().lines().toList() + return out.toByteArray().inputStream().bufferedReader().lines().toList() } private fun createMockNetworkMapClient(): NetworkMapClient {