// create same class with second field
final ClassLoader loaderForCustomClassInVersion2 = ClassGenerationUtil.makeClassLoaderForCustomClass( this.getClass().getClassLoader(), TEST_TYPE_CLASS_NAME, "field1", "field2" );
final SessionAttributesTranscoder secondTranscoder = new KryoTranscoderFactory().createTranscoder( loaderForCustomClassInVersion2 );
// this should lead to an exception
secondTranscoder.deserializeAttributes( data );
}
private static Object makeValueInstance( ClassLoader loaderForCustomClass ) {
try {
Class<?> forName = Class.forName( TEST_TYPE_CLASS_NAME, true, loaderForCustomClass );