Class TestConfig
java.lang.Object
me.josephsf.jobportaljosephsfeirtest.config.TestConfig
Configuration class for Jackson ObjectMapper in test environment.
This class registers the JavaTimeModule to properly handle Java 8 date and time types like LocalDateTime, LocalDate, etc. in test context. It ensures that our controller tests can properly serialize and deserialize date/time objects.
- Since:
- 2025-05-17
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.ObjectMapperCreates and configures the ObjectMapper with support for Java 8 date/time types for testing.
-
Constructor Details
-
TestConfig
public TestConfig()
-
-
Method Details
-
objectMapper
Creates and configures the ObjectMapper with support for Java 8 date/time types for testing.This bean is marked as @Primary to ensure it overrides any other ObjectMapper beans defined by Spring Boot's auto-configuration in the test context.
- Returns:
- A configured ObjectMapper instance with JavaTimeModule registered
-