diff --git a/node-api-tests/build.gradle b/node-api-tests/build.gradle new file mode 100644 index 0000000000..50cf05a864 --- /dev/null +++ b/node-api-tests/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'kotlin' + +description 'NodeAPI tests that require node etc' + +dependencies { + testCompile project(":node-api") + testCompile project(path: ':node-api', configuration:'testArtifacts') + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + testImplementation "junit:junit:$junit_version" + + testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + // Unit testing helpers. + testCompile "org.assertj:assertj-core:$assertj_version" + testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" + testCompile project(':node-driver') + testCompile project(':test-utils') +} diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/AttachmentsClassLoaderStaticContractTests.kt similarity index 91% rename from node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt rename to node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/AttachmentsClassLoaderStaticContractTests.kt index 27276cb615..500e0e2873 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/AttachmentsClassLoaderStaticContractTests.kt @@ -1,4 +1,4 @@ -package net.corda.nodeapi.internal +package net.corda.nodeapitests.internal import com.nhaarman.mockito_kotlin.any import com.nhaarman.mockito_kotlin.doReturn @@ -19,7 +19,7 @@ import net.corda.core.transactions.TransactionBuilder import net.corda.nodeapi.internal.cordapp.CordappLoader import net.corda.node.internal.cordapp.CordappProviderImpl import net.corda.node.internal.cordapp.JarScanningCordappLoader -import net.corda.nodeapi.internal.AttachmentsClassLoaderStaticContractTests.AttachmentDummyContract.Companion.ATTACHMENT_PROGRAM_ID +import net.corda.nodeapitests.internal.AttachmentsClassLoaderStaticContractTests.AttachmentDummyContract.Companion.ATTACHMENT_PROGRAM_ID import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule @@ -45,7 +45,7 @@ class AttachmentsClassLoaderStaticContractTests { class AttachmentDummyContract : Contract { companion object { - const val ATTACHMENT_PROGRAM_ID = "net.corda.nodeapi.internal.AttachmentsClassLoaderStaticContractTests\$AttachmentDummyContract" + const val ATTACHMENT_PROGRAM_ID = "net.corda.nodeapitests.internal.AttachmentsClassLoaderStaticContractTests\$AttachmentDummyContract" } data class State(val magicNumber: Int = 0) : ContractState { @@ -75,7 +75,7 @@ class AttachmentsClassLoaderStaticContractTests { } private val serviceHub get() = rigorousMock().also { - val cordappProviderImpl = CordappProviderImpl(cordappLoaderForPackages(listOf("net.corda.nodeapi.internal")), MockCordappConfigProvider(), MockAttachmentStorage()) + val cordappProviderImpl = CordappProviderImpl(cordappLoaderForPackages(listOf("net.corda.nodeapitests.internal")), MockCordappConfigProvider(), MockAttachmentStorage()) cordappProviderImpl.start() doReturn(cordappProviderImpl).whenever(it).cordappProvider doReturn(networkParametersService).whenever(it).networkParametersService @@ -95,7 +95,8 @@ class AttachmentsClassLoaderStaticContractTests { @Test(timeout=300_000) fun `test serialization of WireTransaction with statically loaded contract`() { - val tx = AttachmentDummyContract().generateInitial(MEGA_CORP.ref(0), 42, DUMMY_NOTARY) + val tx = AttachmentDummyContract() + .generateInitial(MEGA_CORP.ref(0), 42, DUMMY_NOTARY) val wireTransaction = tx.toWireTransaction(serviceHub) val bytes = wireTransaction.serialize() val copiedWireTransaction = bytes.deserialize() diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/CordaPersistenceTest.kt similarity index 98% rename from node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt rename to node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/CordaPersistenceTest.kt index 7b7cea187f..0ed8476f0c 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/CordaPersistenceTest.kt @@ -1,4 +1,4 @@ -package net.corda.nodeapi.internal +package net.corda.nodeapitests.internal import net.corda.node.services.schema.NodeSchemaService import net.corda.nodeapi.internal.persistence.DatabaseConfig diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/crypto/X509UtilitiesTest.kt similarity index 98% rename from node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt rename to node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/crypto/X509UtilitiesTest.kt index f548fb0487..61b936d5d2 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/crypto/X509UtilitiesTest.kt @@ -1,4 +1,4 @@ -package net.corda.nodeapi.internal.crypto +package net.corda.nodeapitests.internal.crypto import io.netty.handler.ssl.ClientAuth @@ -42,6 +42,14 @@ import net.corda.coretesting.internal.NettyTestHandler import net.corda.coretesting.internal.NettyTestServer import net.corda.testing.internal.createDevIntermediateCaCertPath import net.corda.coretesting.internal.stubs.CertificateStoreStubs +import net.corda.nodeapi.internal.crypto.CertificateType +import net.corda.nodeapi.internal.crypto.X509Utilities +import net.corda.nodeapi.internal.crypto.checkValidity +import net.corda.nodeapi.internal.crypto.getSupportedKey +import net.corda.nodeapi.internal.crypto.loadOrCreateKeyStore +import net.corda.nodeapi.internal.crypto.save +import net.corda.nodeapi.internal.crypto.toBc +import net.corda.nodeapi.internal.crypto.x509 import net.i2p.crypto.eddsa.EdDSAPrivateKey import org.assertj.core.api.Assertions.assertThat import org.bouncycastle.asn1.x509.* diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/network/NetworkBootstrapperTest.kt similarity index 96% rename from node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt rename to node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/network/NetworkBootstrapperTest.kt index 4d94be99a6..a06626a792 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/network/NetworkBootstrapperTest.kt @@ -1,4 +1,4 @@ -package net.corda.nodeapi.internal.network +package net.corda.nodeapitests.internal.network import com.typesafe.config.ConfigFactory import net.corda.core.crypto.secureRandomBytes @@ -24,6 +24,14 @@ import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity import net.corda.coretesting.internal.createNodeInfoAndSigned +import net.corda.nodeapi.internal.network.CopyCordapps +import net.corda.nodeapi.internal.network.NETWORK_PARAMS_FILE_NAME +import net.corda.nodeapi.internal.network.NetworkBootstrapper +import net.corda.nodeapi.internal.network.NetworkParametersOverrides +import net.corda.nodeapi.internal.network.PackageOwner +import net.corda.nodeapi.internal.network.SignedNetworkParameters +import net.corda.nodeapi.internal.network.TestContractsJar +import net.corda.nodeapi.internal.network.verifiedNetworkParametersCert import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.After @@ -72,7 +80,9 @@ class NetworkBootstrapperTest { private val bootstrapper = NetworkBootstrapper( initSerEnv = false, - embeddedCordaJar = { fakeEmbeddedCordaJar.toUri().toURL() }, + embeddedCordaJar = { + fakeEmbeddedCordaJar.toUri().toURL() + }, nodeInfosGenerator = { nodeDirs -> nodeDirs.map { nodeDir -> val name = nodeDir.fakeNodeConfig.myLegalName diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/persistence/MissingSchemaMigrationTest.kt similarity index 92% rename from node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt rename to node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/persistence/MissingSchemaMigrationTest.kt index 1c975cd93a..b81a0eaceb 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/persistence/MissingSchemaMigrationTest.kt @@ -1,7 +1,10 @@ -package net.corda.nodeapi.internal.persistence +package net.corda.nodeapitests.internal.persistence import net.corda.core.schemas.MappedSchema import net.corda.core.schemas.PersistentState +import net.corda.nodeapi.internal.persistence.DatabaseConfig +import net.corda.nodeapi.internal.persistence.MissingMigrationException +import net.corda.nodeapi.internal.persistence.SchemaMigration import net.corda.node.internal.DataSourceFactory import net.corda.node.services.persistence.DBCheckpointStorage import net.corda.node.services.schema.NodeSchemaService diff --git a/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/serialization/kryo/KryoAttachmentTest.kt b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/serialization/kryo/KryoAttachmentTest.kt new file mode 100644 index 0000000000..ea256b786b --- /dev/null +++ b/node-api-tests/src/test/kotlin/net/corda/nodeapitests/internal/serialization/kryo/KryoAttachmentTest.kt @@ -0,0 +1,65 @@ +package net.corda.nodeapitests.internal.serialization.kryo + +import com.nhaarman.mockito_kotlin.doReturn +import com.nhaarman.mockito_kotlin.whenever +import net.corda.core.crypto.SecureHash +import net.corda.core.serialization.EncodingWhitelist +import net.corda.core.serialization.internal.CheckpointSerializationContext +import net.corda.core.serialization.internal.checkpointDeserialize +import net.corda.core.serialization.internal.checkpointSerialize +import net.corda.coretesting.internal.rigorousMock +import net.corda.node.services.persistence.NodeAttachmentService +import net.corda.serialization.internal.AllWhitelist +import net.corda.serialization.internal.CheckpointSerializationContextImpl +import net.corda.serialization.internal.CordaSerializationEncoding +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.TestIdentity +import net.corda.testing.core.internal.CheckpointSerializationEnvironmentRule +import org.junit.Assert +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.Parameterized +import java.io.InputStream + +@RunWith(Parameterized::class) +class KryoAttachmentTest(private val compression: CordaSerializationEncoding?) { + companion object { + @Parameterized.Parameters(name = "{0}") + @JvmStatic + fun compression() = arrayOf(null) + CordaSerializationEncoding.values() + } + + + @get:Rule + val serializationRule = CheckpointSerializationEnvironmentRule() + private lateinit var context: CheckpointSerializationContext + + @Before + fun setup() { + context = CheckpointSerializationContextImpl( + javaClass.classLoader, + AllWhitelist, + emptyMap(), + true, + compression, + rigorousMock().also { + if (compression != null) doReturn(true).whenever(it).acceptEncoding(compression) + }) + } + + @Test(timeout=300_000) + fun `HashCheckingStream (de)serialize`() { + val rubbish = ByteArray(12345) { (it * it * 0.12345).toByte() } + val readRubbishStream: InputStream = NodeAttachmentService.HashCheckingStream( + SecureHash.sha256(rubbish), + rubbish.size, + rubbish.inputStream() + ).checkpointSerialize(context).checkpointDeserialize(context) + for (i in 0..12344) { + Assert.assertEquals(rubbish[i], readRubbishStream.read().toByte()) + } + Assert.assertEquals(-1, readRubbishStream.read()) + } +} \ No newline at end of file diff --git a/node-api/build.gradle b/node-api/build.gradle index 3f1797aa94..2f5f774b9a 100644 --- a/node-api/build.gradle +++ b/node-api/build.gradle @@ -54,8 +54,7 @@ dependencies { // Unit testing helpers. testCompile "org.assertj:assertj-core:$assertj_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testCompile project(':node-driver') - testCompile project(':test-utils') + testCompile project(':core-test-utils') compile ("org.apache.activemq:artemis-amqp-protocol:${artemis_version}") { // Gains our proton-j version from core module. @@ -74,6 +73,7 @@ task testJar(type: Jar) { artifacts { testArtifacts testJar + publish testJar } jar { diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapper.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapper.kt index bbeff4adce..d2f8da84c3 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapper.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapper.kt @@ -54,7 +54,7 @@ import kotlin.streams.toList // TODO Move this to tools:bootstrapper class NetworkBootstrapper @VisibleForTesting -internal constructor(private val initSerEnv: Boolean, +constructor(private val initSerEnv: Boolean, private val embeddedCordaJar: () -> URL, private val nodeInfosGenerator: (List) -> List, private val contractsJarConverter: (Path) -> ContractsJar) : NetworkBootstrapperWithOverridableParameters { diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt index 00a2bc3650..3802a357b0 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt @@ -3,8 +3,8 @@ package net.corda.nodeapi.internal.protonwrapper.netty import net.corda.core.crypto.SecureHash import net.corda.core.identity.CordaX500Name import net.corda.core.utilities.NetworkHostAndPort +import net.corda.coretesting.internal.configureTestSSL import net.corda.nodeapi.internal.config.CertificateStore -import net.corda.testing.internal.configureTestSSL import org.junit.Test import javax.net.ssl.KeyManagerFactory import javax.net.ssl.SNIHostName diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt index 1fae69d049..c0142f8105 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt @@ -18,7 +18,6 @@ import net.corda.core.serialization.internal.checkpointSerialize import net.corda.core.utilities.ByteSequence import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.sequence -import net.corda.node.services.persistence.NodeAttachmentService import net.corda.serialization.internal.* import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.TestIdentity @@ -198,20 +197,6 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertTrue(logger === logger2) } - @Test(timeout=300_000) - fun `HashCheckingStream (de)serialize`() { - val rubbish = ByteArray(12345) { (it * it * 0.12345).toByte() } - val readRubbishStream: InputStream = NodeAttachmentService.HashCheckingStream( - SecureHash.sha256(rubbish), - rubbish.size, - rubbish.inputStream() - ).checkpointSerialize(context).checkpointDeserialize(context) - for (i in 0..12344) { - assertEquals(rubbish[i], readRubbishStream.read().toByte()) - } - assertEquals(-1, readRubbishStream.read()) - } - @CordaSerializable private data class Person(val name: String, val birthday: Instant?) diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt index 92e8c72287..2586a67ced 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt @@ -14,6 +14,7 @@ import net.corda.core.messaging.CordaRPCOps import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.unwrap +import net.corda.coretesting.internal.configureTestSSL import net.corda.node.internal.NodeWithInfo import net.corda.nodeapi.RPCApi import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.INTERNAL_PREFIX @@ -22,7 +23,6 @@ import net.corda.nodeapi.internal.config.MutualSslConfiguration import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.singleIdentity -import net.corda.testing.internal.configureTestSSL import net.corda.testing.node.User import net.corda.testing.node.internal.NodeBasedTest import net.corda.testing.node.internal.startFlow diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/SimpleMQClient.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/SimpleMQClient.kt index 44e59852a9..fa5fc09d53 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/SimpleMQClient.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/SimpleMQClient.kt @@ -3,9 +3,9 @@ package net.corda.services.messaging import net.corda.core.identity.CordaX500Name import net.corda.core.serialization.internal.nodeSerializationEnv import net.corda.core.utilities.NetworkHostAndPort +import net.corda.coretesting.internal.configureTestSSL import net.corda.nodeapi.internal.ArtemisTcpTransport.Companion.p2pConnectorTcpTransport import net.corda.nodeapi.internal.config.MutualSslConfiguration -import net.corda.testing.internal.configureTestSSL import org.apache.activemq.artemis.api.core.client.* /** diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt index bd59890436..b33b093467 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt @@ -16,6 +16,7 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.internal.notary.UniquenessProvider import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.minutes +import net.corda.coretesting.internal.configureTestSSL import net.corda.node.services.schema.NodeSchemaService import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.persistence.CordaPersistence @@ -29,7 +30,6 @@ import net.corda.testing.core.generateStateRef import net.corda.testing.internal.LogHelper import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.configureTestSSL import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.node.TestClock import net.corda.testing.node.internal.MockKeyManagementService diff --git a/settings.gradle b/settings.gradle index 8a636cdf94..2fbb64d38e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,6 +18,7 @@ include 'core' include 'core-tests' include 'docs' include 'node-api' +include 'node-api-tests' include 'node' include 'node:capsule' include 'node:djvm' diff --git a/testing/core-test-utils/build.gradle b/testing/core-test-utils/build.gradle index 53954ea735..c58fe75c7d 100644 --- a/testing/core-test-utils/build.gradle +++ b/testing/core-test-utils/build.gradle @@ -3,14 +3,15 @@ plugins { id 'net.corda.plugins.publish-utils' id 'net.corda.plugins.api-scanner' id 'com.jfrog.artifactory' + id 'java-library' } description 'Core test types and helpers for testing Corda' dependencies { implementation project(':core') - implementation project(':test-common') - compile "org.jetbrains.kotlin:kotlin-test" + api project(':test-common') + api "org.jetbrains.kotlin:kotlin-test" } jar { diff --git a/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/CoreTestUtils.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/CoreTestUtils.kt new file mode 100644 index 0000000000..66b8810232 --- /dev/null +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/CoreTestUtils.kt @@ -0,0 +1,21 @@ +package net.corda.coretesting.internal + +import net.corda.core.identity.CordaX500Name +import net.corda.coretesting.internal.stubs.CertificateStoreStubs +import net.corda.nodeapi.internal.config.MutualSslConfiguration +import net.corda.nodeapi.internal.loadDevCaTrustStore +import net.corda.nodeapi.internal.registerDevP2pCertificates +import java.nio.file.Files + +fun configureTestSSL(legalName: CordaX500Name): MutualSslConfiguration { + + val certificatesDirectory = Files.createTempDirectory("certs") + val config = CertificateStoreStubs.P2P.withCertificatesDirectory(certificatesDirectory) + if (config.trustStore.getOptional() == null) { + loadDevCaTrustStore().copyTo(config.trustStore.get(true)) + } + if (config.keyStore.getOptional() == null) { + config.keyStore.get(true).registerDevP2pCertificates(legalName) + } + return config +} diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt index 0d4698b58e..84e7091d1f 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt @@ -67,19 +67,6 @@ inline fun T.amqpSpecific(reason: String, function: () -> Unit loggerFor().info("Ignoring AMQP specific test, reason: $reason") } -fun configureTestSSL(legalName: CordaX500Name): MutualSslConfiguration { - - val certificatesDirectory = Files.createTempDirectory("certs") - val config = CertificateStoreStubs.P2P.withCertificatesDirectory(certificatesDirectory) - if (config.trustStore.getOptional() == null) { - loadDevCaTrustStore().copyTo(config.trustStore.get(true)) - } - if (config.keyStore.getOptional() == null) { - config.keyStore.get(true).registerDevP2pCertificates(legalName) - } - return config -} - private val defaultRootCaName = X500Principal("CN=Corda Root CA,O=R3 Ltd,L=London,C=GB") private val defaultIntermediateCaName = X500Principal("CN=Corda Intermediate CA,O=R3 Ltd,L=London,C=GB")