mirror of
https://github.com/corda/corda.git
synced 2025-06-01 15:10:54 +00:00
Review Comments - give test methods a better name
This commit is contained in:
parent
1e023fcf54
commit
414f2b4b40
@ -28,7 +28,7 @@ data class BytesAndSchema<T : Any>(val obj: SerializedBytes<T>, val schema: Sche
|
|||||||
// Extension for the serialize routine that returns the scheme encoded into the
|
// Extension for the serialize routine that returns the scheme encoded into the
|
||||||
// bytes as well as the bytes for simple testing
|
// bytes as well as the bytes for simple testing
|
||||||
@Throws(NotSerializableException::class)
|
@Throws(NotSerializableException::class)
|
||||||
fun <T : Any> SerializationOutput.serializeRtnSchema(obj: T): BytesAndSchema<T> {
|
fun <T : Any> SerializationOutput.serializeAndReturnSchema(obj: T): BytesAndSchema<T> {
|
||||||
try {
|
try {
|
||||||
return BytesAndSchema(_serialize(obj), Schema(schemaHistory.toList()))
|
return BytesAndSchema(_serialize(obj), Schema(schemaHistory.toList()))
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -22,7 +22,7 @@ class SerializeAndReturnSchemaTest {
|
|||||||
val a = 1
|
val a = 1
|
||||||
val b = 2
|
val b = 2
|
||||||
|
|
||||||
val sc = SerializationOutput(factory).serializeRtnSchema(C(a, b))
|
val sc = SerializationOutput(factory).serializeAndReturnSchema(C(a, b))
|
||||||
|
|
||||||
assertEquals(1, sc.schema.types.size)
|
assertEquals(1, sc.schema.types.size)
|
||||||
assertEquals(classTestName("C"), sc.schema.types.first().name)
|
assertEquals(classTestName("C"), sc.schema.types.first().name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user