I have problems LocalDateTime deserialization in Junit test. I have simple REST API which returns some DTO object. When I
LocalDateTime
Junit
REST API
DTO
You create new ObjectMapper in test class:
ObjectMapper
MyDto dto = new ObjectMapper().readValue(json, MyDto.class);
Try to inject ObjectMapper from Spring context or manually register module:
Spring
mapper.registerModule(new JavaTimeModule());
See also: