mirror of
https://github.com/corda/corda.git
synced 2024-12-23 14:52:29 +00:00
node: Fix JsonSupportTest imports
This commit is contained in:
parent
bd59022e8f
commit
618f46cba4
@ -1,22 +1,25 @@
|
||||
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.node.utilities.JsonSupport
|
||||
import com.r3corda.testing.node.MockIdentityService
|
||||
import net.i2p.crypto.eddsa.EdDSAPublicKey
|
||||
import org.junit.runner.RunWith
|
||||
import java.security.PublicKey
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@RunWith(com.pholser.junit.quickcheck.runner.JUnitQuickcheck::class)
|
||||
@RunWith(JUnitQuickcheck::class)
|
||||
class JsonSupportTest {
|
||||
|
||||
companion object {
|
||||
val mapper = JsonSupport.createDefaultMapper(MockIdentityService(mutableListOf()))
|
||||
}
|
||||
|
||||
@com.pholser.junit.quickcheck.Property
|
||||
fun publicKeySerializingWorks(@com.pholser.junit.quickcheck.From(PublicKeyGenerator::class) publicKey: PublicKey) {
|
||||
@Property
|
||||
fun publicKeySerializingWorks(@From(PublicKeyGenerator::class) publicKey: PublicKey) {
|
||||
val serialized = mapper.writeValueAsString(publicKey)
|
||||
val parsedKey = mapper.readValue(serialized, EdDSAPublicKey::class.java)
|
||||
assertEquals(publicKey, parsedKey)
|
||||
|
Loading…
Reference in New Issue
Block a user