Class ModelRequestSerializationCallback
java.lang.Object
ai.timefold.solver.service.test.impl.quarkus.ModelRequestSerializationCallback
- All Implemented Interfaces:
io.quarkus.test.junit.callback.QuarkusTestBeforeClassCallback
public class ModelRequestSerializationCallback
extends Object
implements io.quarkus.test.junit.callback.QuarkusTestBeforeClassCallback
The default RestAssured object mapper serializes LocalDate as an array and by that fails platform schema validation.
This Quarkus test before class callback configures RestAssuredConfig.objectMapperConfig(ObjectMapperConfig)
to use the ObjectMapper customized with the SDK defaults:
- Enables failing on unknown properties.
- Serialize only non-null properties by default
JsonInclude.Include.NON_NULL. - Serialize datetime and duration objects as strings, rather than numeric timestamps.
- Prevents adjusting the time zone offset values to the context time zone when serializing/deserializing.
A concrete model can opt-out of this behaviour by setting the system property
"ai.timefold.platform.model.test.serialization.callback.disable" to true.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER -
DISABLE_SERIALIZATION_CALLBACK_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
ModelRequestSerializationCallback
public ModelRequestSerializationCallback()
-
-
Method Details
-
beforeClass
- Specified by:
beforeClassin interfaceio.quarkus.test.junit.callback.QuarkusTestBeforeClassCallback
-