简体   繁体   中英

Unit Testing Quarkus with quarkus-smallrye-openapi causing InvalidDefinitionException Java 8 date/time type `java.time.LocalDate` not supported

I'am using quarkus-smallrye-openapi in a quarkus 1.13.0.Final application. Everything works fine when I execute the program with mvnw compile quarkus:dev . However, when I execute the unit tests having some variable of LocalDate data type by running mvn test the program then fails to marshal and unmarshal LocalDate type objects from json and it produces

 "com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
Java 8 date/time type java.time.LocalDate not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling"

when I remove the quarkus-smallrye-openapi dependency and relevant annotations, then the test run fine.

This sounds very much like a bug. Please open an issue on https://github.com/quarkusio/quarkus/issues

UPDATE :

The issue opened was: https://github.com/quarkusio/quarkus/issues/16343 It turned out that quarkus-resteasy-jsonb was being used instead of quarkus-resteasy-jsonb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM