node: Fix JsonSupportTest imports

This commit is contained in:
Andras Slemmer 2016-09-06 13:59:01 +01:00
parent bd59022e8f
commit 618f46cba4

View File

@ -1,22 +1,25 @@
package com.r3corda.node package com.r3corda.node
import com.r3corda.core.node.services.testing.MockIdentityService import com.pholser.junit.quickcheck.From
import com.pholser.junit.quickcheck.Property
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck
import com.r3corda.core.testing.PublicKeyGenerator import com.r3corda.core.testing.PublicKeyGenerator
import com.r3corda.node.utilities.JsonSupport import com.r3corda.node.utilities.JsonSupport
import com.r3corda.testing.node.MockIdentityService
import net.i2p.crypto.eddsa.EdDSAPublicKey import net.i2p.crypto.eddsa.EdDSAPublicKey
import org.junit.runner.RunWith import org.junit.runner.RunWith
import java.security.PublicKey import java.security.PublicKey
import kotlin.test.assertEquals import kotlin.test.assertEquals
@RunWith(com.pholser.junit.quickcheck.runner.JUnitQuickcheck::class) @RunWith(JUnitQuickcheck::class)
class JsonSupportTest { class JsonSupportTest {
companion object { companion object {
val mapper = JsonSupport.createDefaultMapper(MockIdentityService(mutableListOf())) val mapper = JsonSupport.createDefaultMapper(MockIdentityService(mutableListOf()))
} }
@com.pholser.junit.quickcheck.Property @Property
fun publicKeySerializingWorks(@com.pholser.junit.quickcheck.From(PublicKeyGenerator::class) publicKey: PublicKey) { fun publicKeySerializingWorks(@From(PublicKeyGenerator::class) publicKey: PublicKey) {
val serialized = mapper.writeValueAsString(publicKey) val serialized = mapper.writeValueAsString(publicKey)
val parsedKey = mapper.readValue(serialized, EdDSAPublicKey::class.java) val parsedKey = mapper.readValue(serialized, EdDSAPublicKey::class.java)
assertEquals(publicKey, parsedKey) assertEquals(publicKey, parsedKey)