mirror of
https://github.com/corda/corda.git
synced 2025-01-18 10:46:38 +00:00
Fixed JUnit to not use a deprecated/removed JDK package "com.sun.xml.internal.messaging.saaj".
This commit is contained in:
parent
c8eb13efe2
commit
4db2447e0b
@ -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<String> {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user