mirror of
https://github.com/corda/corda.git
synced 2025-01-11 15:32:49 +00:00
node: Fix JsonSupportTest imports
This commit is contained in:
parent
bd59022e8f
commit
618f46cba4
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user