|
|
|
@ -2,6 +2,7 @@ package org.redisson.codec;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
|
|
|
@ -37,6 +38,17 @@ public class JsonJacksonCodecTest {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldSerializeAndDeserializeThrowable() throws JsonProcessingException {
|
|
|
|
|
//given
|
|
|
|
|
ObjectMapper objectMapper = JsonJacksonCodec.INSTANCE.getObjectMapper();
|
|
|
|
|
//when
|
|
|
|
|
String serialized = objectMapper.writeValueAsString(new RuntimeException("Example message"));
|
|
|
|
|
RuntimeException deserialized = objectMapper.readValue(serialized, RuntimeException.class);
|
|
|
|
|
//then
|
|
|
|
|
Assertions.assertEquals("Example message", deserialized.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldNotOverrideProvidedObjectMapperProperties() {
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
|