mirror of
https://github.com/corda/corda.git
synced 2024-12-19 21:17:58 +00:00
Unit test covering https://r3-cev.atlassian.net/browse/CORDA-2674
This commit is contained in:
parent
74c5b8d127
commit
2173228b27
@ -97,4 +97,53 @@ public class JavaEvolutionTests {
|
||||
N2.class,
|
||||
TestSerializationContext.testSerializationContext);
|
||||
}
|
||||
|
||||
// Class as it was when it was serialized and written to disk. Uncomment
|
||||
// if the test referencing the object needs regenerating.
|
||||
/*
|
||||
@SuppressWarnings("unused")
|
||||
static class POJOWithInteger {
|
||||
private Integer id;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public interface ForceEvolution { }
|
||||
|
||||
// Class as it exists now with the newly added element
|
||||
@SuppressWarnings("unused")
|
||||
static class POJOWithInteger implements ForceEvolution {
|
||||
private Integer id;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullableInteger() throws IOException {
|
||||
// Uncomment to regenerate the base state of the test
|
||||
//POJOWithInteger n = new POJOWithInteger();
|
||||
//n.setId(100);
|
||||
//AMQPTestUtilsKt.writeTestResource(this, new SerializationOutput(factory).serialize(
|
||||
// n, TestSerializationContext.testSerializationContext));
|
||||
|
||||
POJOWithInteger n2 = new DeserializationInput(factory).deserialize(
|
||||
new SerializedBytes<>(AMQPTestUtilsKt.readTestResource(this)),
|
||||
POJOWithInteger.class,
|
||||
TestSerializationContext.testSerializationContext);
|
||||
|
||||
assertEquals(Integer.valueOf(100), n2.getId());
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user