@Test public void testJsonSerializationEnumVersionOld() throws Exception { VersionedObject obj = new VersionedObject(); obj.setEnumField(VersionedEnum.Value3); assertEquals( obj, versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "json")); }
@Test public void testBinarySerializationEnumVersionNew() throws Exception { VersionedObject obj = new VersionedObject(); obj.setEnumField(VersionedEnum.Value4); assertEquals( obj, versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "binary")); }
@Test public void testJsonSerializationEnumVersionUseRemovedValue() throws Exception { thrown.expect(TeslaSerializationException.class); thrown.expectMessage("is not allowed"); VersionedObject obj = new VersionedObject(); obj.setEnumField(VersionedEnum.Value3); versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "json"); }
@Test public void testBinarySerializationEnumVersionUseNewValueInOldVersion() throws Exception { thrown.expect(TeslaSerializationException.class); thrown.expectMessage("is not allowed"); VersionedObject obj = new VersionedObject(); obj.setEnumField(VersionedEnum.Value4); versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "binary"); }