From fdcb6f574c709aee0c971c98ed62288e10c1a377 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 23 Feb 2024 16:09:50 +0100 Subject: [PATCH] TMP --- .../backend/InMemoryWithFilesStorageIT.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesStorageIT.java b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesStorageIT.java index e4eaf3ab..0d63b7ed 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesStorageIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesStorageIT.java @@ -1,8 +1,13 @@ package de.juplo.kafka.chat.backend; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; import java.io.IOException; @@ -15,6 +20,7 @@ import java.nio.file.Paths; "chat.backend.inmemory.sharding-strategy=none", "chat.backend.inmemory.storage-strategy=files", "chat.backend.inmemory.storage-directory=target/files" }) +@ContextConfiguration(classes = InMemoryWithFilesStorageIT.TestConfig.class) @Slf4j public class InMemoryWithFilesStorageIT extends AbstractInMemoryStorageIT { @@ -47,4 +53,17 @@ public class InMemoryWithFilesStorageIT extends AbstractInMemoryStorageIT Files.delete(path); } } + + + static class TestConfig + { + @Bean + ObjectMapper objectMapper() + { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + return objectMapper; + } + } } -- 2.20.1