Refactors master serializer name from EventMapper to JsonMapper
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ package com.vitorpamplona.quartz.nip01Core.metadata
|
||||
|
||||
import com.vitorpamplona.quartz.nip01Core.core.Event
|
||||
import com.vitorpamplona.quartz.nip01Core.jackson.EventManualSerializer
|
||||
import com.vitorpamplona.quartz.nip01Core.jackson.EventMapper
|
||||
import com.vitorpamplona.quartz.nip01Core.jackson.JsonMapper
|
||||
import com.vitorpamplona.quartz.utils.nsecToSigner
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
@@ -35,7 +35,7 @@ class UpdateMetadataTest {
|
||||
*/
|
||||
fun Event.toPrettyJson(): String {
|
||||
val obj = EventManualSerializer.assemble(id, pubKey, createdAt, kind, tags, content, sig)
|
||||
return EventMapper.mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj)
|
||||
return JsonMapper.mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-2
@@ -20,14 +20,14 @@
|
||||
*/
|
||||
package com.vitorpamplona.quartz.nip46RemoteSigner
|
||||
|
||||
import com.vitorpamplona.quartz.nip01Core.jackson.EventMapper
|
||||
import com.vitorpamplona.quartz.nip01Core.jackson.JsonMapper
|
||||
import org.junit.Test
|
||||
|
||||
class BunkerRequestTest {
|
||||
@Test
|
||||
fun testBunkerRequestDeSerialization() {
|
||||
val requestJson = """{"id":"123","method":"sign_event","params":["{\"created_at\":1234,\"kind\":1,\"tags\":[],\"content\":\"This is an unsigned event.\"}"]}"""
|
||||
val bunkerRequest = EventMapper.mapper.readValue(requestJson, BunkerRequest::class.java)
|
||||
val bunkerRequest = JsonMapper.mapper.readValue(requestJson, BunkerRequest::class.java)
|
||||
|
||||
assert(bunkerRequest is BunkerRequestSign)
|
||||
assert((bunkerRequest as BunkerRequestSign).event.kind == 1)
|
||||
|
||||
Reference in New Issue
Block a user