From: Kai Moritz Date: Fri, 23 Feb 2024 15:09:50 +0000 (+0100) Subject: TMP X-Git-Tag: rebase--2024-02-23--16-28~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=fdcb6f574c709aee0c971c98ed62288e10c1a377;p=demos%2Fkafka%2Fchat TMP --- 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; + } + } }