use of org.springframework.core.serializer.support.SerializationFailedException in project spring-framework by spring-projects.
the class SerializationConverterTests method nonSerializableField.
@Test
public void nonSerializableField() {
SerializingConverter toBytes = new SerializingConverter();
try {
toBytes.convert(new UnSerializable());
fail("Expected SerializationFailureException");
} catch (SerializationFailedException e) {
assertNotNull(e.getCause());
assertTrue(e.getCause() instanceof NotSerializableException);
}
}
use of org.springframework.core.serializer.support.SerializationFailedException in project spring-framework by spring-projects.
the class SerializationConverterTests method nonSerializableObject.
@Test
public void nonSerializableObject() {
SerializingConverter toBytes = new SerializingConverter();
try {
toBytes.convert(new Object());
fail("Expected IllegalArgumentException");
} catch (SerializationFailedException e) {
assertNotNull(e.getCause());
assertTrue(e.getCause() instanceof IllegalArgumentException);
}
}
Aggregations