mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
addressed PR issues
This commit is contained in:
parent
ed557f5391
commit
57283c96c3
@ -32,7 +32,7 @@ class CertificateSigningServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSubmitRequest() {
|
fun `test submit request`() {
|
||||||
val id = SecureHash.randomSHA256().toString()
|
val id = SecureHash.randomSHA256().toString()
|
||||||
|
|
||||||
val storage: CertificationRequestStorage = mock {
|
val storage: CertificationRequestStorage = mock {
|
||||||
@ -60,7 +60,7 @@ class CertificateSigningServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testRetrieveCertificate() {
|
fun `test retrieve certificate`() {
|
||||||
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
||||||
val id = SecureHash.randomSHA256().toString()
|
val id = SecureHash.randomSHA256().toString()
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class DBCertificateRequestStorageTest {
|
|||||||
val intermediateCA = X509Utilities.createSelfSignedCACert("Corda Node Intermediate CA")
|
val intermediateCA = X509Utilities.createSelfSignedCACert("Corda Node Intermediate CA")
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSaveRequest() {
|
fun `test save request`() {
|
||||||
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
||||||
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class DBCertificateRequestStorageTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPendingRequest() {
|
fun `test pending request`() {
|
||||||
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
||||||
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class DBCertificateRequestStorageTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSaveCertificate() {
|
fun `test save certificate`() {
|
||||||
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
val keyPair = X509Utilities.generateECDSAKeyPairForSSL()
|
||||||
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
val request = CertificationData("", "", X509Utilities.createCertificateSigningRequest("LegalName", "London", "admin@test.com", keyPair))
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@ fun <T> databaseTransaction(db: Database, statement: Transaction.() -> T): T {
|
|||||||
return org.jetbrains.exposed.sql.transactions.transaction(Connection.TRANSACTION_REPEATABLE_READ, 1, statement)
|
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 <T> withFinalizables(statement: (MutableList<() -> Unit>) -> T): T {
|
fun <T> withFinalizables(statement: (MutableList<() -> Unit>) -> T): T {
|
||||||
val finalizables = mutableListOf<() -> Unit>()
|
val finalizables = mutableListOf<() -> Unit>()
|
||||||
return try {
|
return try {
|
||||||
|
Loading…
Reference in New Issue
Block a user