java.lang.Object
me.josephsf.jobportaljosephsfeirtest.config.TestConfig

@Configuration public class TestConfig extends Object
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 Details

    • TestConfig

      public TestConfig()
  • Method Details

    • objectMapper

      @Bean @Primary public com.fasterxml.jackson.databind.ObjectMapper 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