diff --git a/netpermission/src/test/kotlin/com/r3corda/netpermission/CertificateSigningServiceTest.kt b/netpermission/src/test/kotlin/com/r3corda/netpermission/CertificateSigningServiceTest.kt index a4b4bdb360..9389739e25 100644 --- a/netpermission/src/test/kotlin/com/r3corda/netpermission/CertificateSigningServiceTest.kt +++ b/netpermission/src/test/kotlin/com/r3corda/netpermission/CertificateSigningServiceTest.kt @@ -32,7 +32,7 @@ class CertificateSigningServiceTest { } @Test - fun testSubmitRequest() { + fun `test submit request`() { val id = SecureHash.randomSHA256().toString() val storage: CertificationRequestStorage = mock { @@ -60,7 +60,7 @@ class CertificateSigningServiceTest { } @Test - fun testRetrieveCertificate() { + fun `test retrieve certificate`() { val keyPair = X509Utilities.generateECDSAKeyPairForSSL() val id = SecureHash.randomSHA256().toString() diff --git a/netpermission/src/test/kotlin/com/r3corda/netpermission/internal/persistence/DBCertificateRequestStorageTest.kt b/netpermission/src/test/kotlin/com/r3corda/netpermission/internal/persistence/DBCertificateRequestStorageTest.kt index 452a765d61..454c3695f4 100644 --- a/netpermission/src/test/kotlin/com/r3corda/netpermission/internal/persistence/DBCertificateRequestStorageTest.kt +++ b/netpermission/src/test/kotlin/com/r3corda/netpermission/internal/persistence/DBCertificateRequestStorageTest.kt @@ -14,7 +14,7 @@ class DBCertificateRequestStorageTest { val intermediateCA = X509Utilities.createSelfSignedCACert("Corda Node Intermediate CA") @Test - fun testSaveRequest() { + fun `test save request`() { val keyPair = X509Utilities.generateECDSAKeyPairForSSL() val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair)) @@ -32,7 +32,7 @@ class DBCertificateRequestStorageTest { } @Test - fun testPendingRequest() { + fun `test pending request`() { val keyPair = X509Utilities.generateECDSAKeyPairForSSL() val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair)) @@ -49,7 +49,7 @@ class DBCertificateRequestStorageTest { } @Test - fun testSaveCertificate() { + fun `test save certificate`() { val keyPair = X509Utilities.generateECDSAKeyPairForSSL() val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair)) diff --git a/node/src/main/kotlin/com/r3corda/node/utilities/DatabaseSupport.kt b/node/src/main/kotlin/com/r3corda/node/utilities/DatabaseSupport.kt index e7d430f7ce..990ed19375 100644 --- a/node/src/main/kotlin/com/r3corda/node/utilities/DatabaseSupport.kt +++ b/node/src/main/kotlin/com/r3corda/node/utilities/DatabaseSupport.kt @@ -30,6 +30,9 @@ fun databaseTransaction(db: Database, statement: Transaction.() -> T): T { return org.jetbrains.exposed.sql.transactions.transaction(Connection.TRANSACTION_REPEATABLE_READ, 1, statement) } +/** + * Helper method wrapping code in try finally block. A mutable list is used to keep track of functions that need to be executed in finally block. + */ fun withFinalizables(statement: (MutableList<() -> Unit>) -> T): T { val finalizables = mutableListOf<() -> Unit>() return try {