package de.juplo.kafka.chat.backend.implementation.inmemory;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest;
import de.juplo.kafka.chat.backend.implementation.ShardingStrategy;
import de.juplo.kafka.chat.backend.implementation.StorageStrategy;
}
@Bean
- public FilesStorageStrategy storageStrategy(Clock clock)
+ FilesStorageStrategy storageStrategy(
+ Clock clock,
+ ObjectMapper objectMapper)
{
return new FilesStorageStrategy(
Paths.get("target", "test-classes", "data", "files"),
new KafkaLikeShardingStrategy(NUM_SHARDS),
- new ObjectMapper());
+ objectMapper);
+ }
+
+ @Bean
+ ObjectMapper objectMapper()
+ {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.registerModule(new JavaTimeModule());
+ return objectMapper;
}
@Bean
package de.juplo.kafka.chat.backend.implementation.inmemory;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import de.juplo.kafka.chat.backend.domain.ChatHomeServiceTest;
import de.juplo.kafka.chat.backend.implementation.StorageStrategy;
import de.juplo.kafka.chat.backend.storage.files.FilesStorageStrategy;
}
@Bean
- public FilesStorageStrategy storageStrategy(Clock clock)
+ FilesStorageStrategy storageStrategy(
+ Clock clock,
+ ObjectMapper objectMapper)
{
return new FilesStorageStrategy(
Paths.get("target", "test-classes", "data", "files"),
chatRoomId -> 0,
- new ObjectMapper());
+ objectMapper);
+ }
+
+ @Bean
+ ObjectMapper objectMapper()
+ {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.registerModule(new JavaTimeModule());
+ return objectMapper;
}
@Bean