mirror of
https://github.com/corda/corda.git
synced 2025-04-07 19:34:41 +00:00
Fix broken unit test
At the moment the test just asserts we can't evolve enums, it's a placeholder for the next phase of the changes
This commit is contained in:
parent
f135d57820
commit
4c2f0d7913
@ -1,5 +1,6 @@
|
||||
package net.corda.nodeapi.internal.serialization.amqp
|
||||
|
||||
import net.corda.core.serialization.CordaSerializationTransformEnumDefault
|
||||
import net.corda.core.serialization.SerializedBytes
|
||||
import org.assertj.core.api.Assertions
|
||||
import org.junit.Test
|
||||
@ -16,14 +17,10 @@ class EnumEvolveTests {
|
||||
// Version of the class as it was serialised
|
||||
//
|
||||
// @CordaSerializationTransformEnumDefault("D", "C")
|
||||
// enum class DeserializeNewerSetToUnknown {
|
||||
// A, B, C, D
|
||||
// }
|
||||
// enum class DeserializeNewerSetToUnknown { A, B, C, D }
|
||||
//
|
||||
// Version of the class as it's used in the test
|
||||
enum class DeserializeNewerSetToUnknown {
|
||||
A, B, C
|
||||
}
|
||||
enum class DeserializeNewerSetToUnknown { A, B, C }
|
||||
|
||||
@Test
|
||||
fun deserialiseNewerSetToUnknown() {
|
||||
@ -33,11 +30,12 @@ class EnumEvolveTests {
|
||||
data class C (val e : DeserializeNewerSetToUnknown)
|
||||
|
||||
// Uncomment to re-generate test files
|
||||
//File(URI("$localPath/$resource")).writeBytes(
|
||||
// File(URI("$localPath/$resource")).writeBytes(
|
||||
// SerializationOutput(sf).serialize(C(DeserializeNewerSetToUnknown.D)).bytes)
|
||||
|
||||
Assertions.assertThatThrownBy {
|
||||
DeserializationInput(sf).deserialize(SerializedBytes<C>(File(URI("$localPath/$resource")).readBytes()))
|
||||
DeserializationInput(sf).deserialize(SerializedBytes<C>(
|
||||
File(EvolvabilityTests::class.java.getResource(resource).toURI()).readBytes()))
|
||||
}.isInstanceOf(NotSerializableException::class.java)
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user