java- feign: Cannot deserialize java.time.Instant

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


java- feign: Cannot deserialize java.time.Instant



In my model, there are some fields of type Instant. Looks like feign is unable to deserialize it. I get below error message while running my tests:


feign.FeignException: Can not construct instance of java.time.Instant: no String-argument constructor/factory method to deserialize from String value ('2018-07-29T21:28:23.013Z')
at [Source: java.io.BufferedReader@3f06abd; line: 1, column: 805] (through reference chain: com.test.api.profile.model.testProfile["finishDate"]) reading GET http://localhost:8080/testProfile/<uuid>



I am already doing this in my application.java file


// Customize global JSON serialization settings
bootstrap.getObjectMapper()
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);



and this in the @Before of my test cases:


@Before


objectMapper.registerModule(new JavaTimeModule());



Please help









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham