- @TestConfiguration
- static class Configuration
- {
- @Bean
- SimpleChatHomeService chatHome(
- StorageStrategy storageStrategy,
- Clock clock)
- {
- return new SimpleChatHomeService(
- storageStrategy,
- clock,
- bufferSize());
- }
-
- @Bean
- public FilesStorageStrategy storageStrategy(Clock clock)
- {
- return new FilesStorageStrategy(
- Paths.get("target", "test-classes", "data", "files"),
- chatRoomId -> 0,
- new ObjectMapper());
- }
-
- @Bean
- Clock clock()
- {
- return Clock.systemDefaultZone();
- }
-
- int bufferSize()
- {
- return 8;
- }
- }