addressed PR issues

This commit is contained in:
Patrick Kuo 2016-11-08 10:15:36 +00:00
parent ed557f5391
commit 57283c96c3
3 changed files with 8 additions and 5 deletions

View File

@ -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()

View File

@ -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))

View File

@ -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)
}
/**
* 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 {
val finalizables = mutableListOf<() -> Unit>()
return try {