refactor: `storage` is not a sub-package of `persistence` - Aligned code
authorKai Moritz <kai@juplo.de>
Wed, 6 Sep 2023 21:46:36 +0000 (23:46 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 26 Jan 2024 18:09:00 +0000 (19:09 +0100)
18 files changed:
src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageConfiguration.java
src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
src/main/java/de/juplo/kafka/chat/backend/storage/files/JsonFilePublisher.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/ChatRoomRepository.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/ChatRoomTo.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MessageRepository.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MessageTo.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageConfiguration.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java
src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java
src/test/java/de/juplo/kafka/chat/backend/AbstractInMemoryStorageIT.java
src/test/java/de/juplo/kafka/chat/backend/AbstractStorageStrategyIT.java
src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesStorageIT.java
src/test/java/de/juplo/kafka/chat/backend/InMemoryWithMongoDbStorageIT.java
src/test/java/de/juplo/kafka/chat/backend/persistence/inmemory/ShardedChatHomeServiceTest.java
src/test/java/de/juplo/kafka/chat/backend/persistence/inmemory/SimpleChatHomeServiceTest.java
src/test/resources/data/mongodb/chatRoomTo.json
src/test/resources/data/mongodb/messageTo.json

index 3a59acb..2ed9add 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.files;
+package de.juplo.kafka.chat.backend.storage.files;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import de.juplo.kafka.chat.backend.ChatBackendProperties;
index 9c79197..887aea2 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.files;
+package de.juplo.kafka.chat.backend.storage.files;
 
 import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.databind.JavaType;
index aec8b36..037451f 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.files;
+package de.juplo.kafka.chat.backend.storage.files;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
index 12e5b96..d9f6a0f 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import org.springframework.data.mongodb.repository.MongoRepository;
 
index 0086053..8ea9cc2 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
 import lombok.*;
index a429f96..712f5a4 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import org.springframework.data.mongodb.repository.MongoRepository;
 
index f6c6b85..6b317f9 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import de.juplo.kafka.chat.backend.domain.Message;
 import lombok.*;
index e6f7149..52c6ec6 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import de.juplo.kafka.chat.backend.persistence.ShardingStrategy;
 import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
index 644ab88..5f46e3c 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
+package de.juplo.kafka.chat.backend.storage.mongodb;
 
 import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
 import de.juplo.kafka.chat.backend.domain.Message;
index ab24bb8..5b13be4 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence.storage.nostorage;
+package de.juplo.kafka.chat.backend.storage.nostorage;
 
 import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
 import de.juplo.kafka.chat.backend.domain.Message;
index 3d311a4..703911d 100644 (file)
@@ -1,4 +1,4 @@
-package de.juplo.kafka.chat.backend.persistence;
+package de.juplo.kafka.chat.backend;
 
 import de.juplo.kafka.chat.backend.domain.ChatHomeService;
 import de.juplo.kafka.chat.backend.persistence.inmemory.SimpleChatHomeService;
index c2149bb..03c3aa4 100644 (file)
@@ -1,6 +1,7 @@
-package de.juplo.kafka.chat.backend.persistence;
+package de.juplo.kafka.chat.backend;
 
 import de.juplo.kafka.chat.backend.domain.*;
+import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 
index be40eed..314ee84 100644 (file)
@@ -1,9 +1,10 @@
-package de.juplo.kafka.chat.backend.persistence;
+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 de.juplo.kafka.chat.backend.persistence.storage.files.FilesStorageStrategy;
+import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
+import de.juplo.kafka.chat.backend.storage.files.FilesStorageStrategy;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.BeforeEach;
 
index a0dab37..dbf3334 100644 (file)
@@ -1,9 +1,10 @@
-package de.juplo.kafka.chat.backend.persistence;
+package de.juplo.kafka.chat.backend;
 
-import de.juplo.kafka.chat.backend.persistence.InMemoryWithMongoDbStorageIT.DataSourceInitializer;
-import de.juplo.kafka.chat.backend.persistence.storage.mongodb.ChatRoomRepository;
-import de.juplo.kafka.chat.backend.persistence.storage.mongodb.MessageRepository;
-import de.juplo.kafka.chat.backend.persistence.storage.mongodb.MongoDbStorageStrategy;
+import de.juplo.kafka.chat.backend.InMemoryWithMongoDbStorageIT.DataSourceInitializer;
+import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
+import de.juplo.kafka.chat.backend.storage.mongodb.ChatRoomRepository;
+import de.juplo.kafka.chat.backend.storage.mongodb.MessageRepository;
+import de.juplo.kafka.chat.backend.storage.mongodb.MongoDbStorageStrategy;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.extension.ExtendWith;
index 0363f5d..4c922ce 100644 (file)
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import de.juplo.kafka.chat.backend.domain.ChatHomeServiceWithShardsTest;
 import de.juplo.kafka.chat.backend.persistence.ShardingStrategy;
 import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
-import de.juplo.kafka.chat.backend.persistence.storage.files.FilesStorageStrategy;
+import de.juplo.kafka.chat.backend.storage.files.FilesStorageStrategy;
 import org.springframework.boot.test.context.TestConfiguration;
 import org.springframework.context.annotation.Bean;
 
index 3e3311c..fd5a83b 100644 (file)
@@ -3,7 +3,7 @@ package de.juplo.kafka.chat.backend.persistence.inmemory;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import de.juplo.kafka.chat.backend.domain.ChatHomeServiceTest;
 import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
-import de.juplo.kafka.chat.backend.persistence.storage.files.FilesStorageStrategy;
+import de.juplo.kafka.chat.backend.storage.files.FilesStorageStrategy;
 import org.springframework.boot.test.context.TestConfiguration;
 import org.springframework.context.annotation.Bean;
 
index db26b89..8ce7b7c 100644 (file)
@@ -2,5 +2,5 @@
   "_id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7",
   "shard": 0,
   "name": "FOO",
-  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.ChatRoomTo"
+  "_class": "de.juplo.kafka.chat.backend.storage.mongodb.ChatRoomTo"
 }
index 02fed6f..153e0b4 100644 (file)
@@ -6,7 +6,7 @@
   "serial": 0,
   "time": "2023-01-13T20:43:16.803382151",
   "text": "Hallo, ich heiße Peter!",
-  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.MessageTo"
+  "_class": "de.juplo.kafka.chat.backend.storage.mongodb.MessageTo"
 }
 {
   "_id": "64f7952cecf06d750cad4b9d",
@@ -16,7 +16,7 @@
   "serial": 1,
   "time": "2023-01-13T20:43:16.804049969",
   "text": "Ich bin Ute...",
-  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.MessageTo"
+  "_class": "de.juplo.kafka.chat.backend.storage.mongodb.MessageTo"
 }
 {
   "_id": "64f7952cecf06d750cad4b9e",
@@ -26,7 +26,7 @@
   "serial": 2,
   "time": "2023-01-13T20:43:16.804092782",
   "text": "Willst du mit mir gehen?",
-  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.MessageTo"
+  "_class": "de.juplo.kafka.chat.backend.storage.mongodb.MessageTo"
 }
 {
   "_id": "64f7953ddf7a9063e0b1f7dc",
@@ -36,5 +36,5 @@
   "serial": 3,
   "time": "2023-01-13T20:43:16.804122604",
   "text": "Ja? Nein? Vielleicht??",
-  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.MessageTo"
+  "_class": "de.juplo.kafka.chat.backend.storage.mongodb.MessageTo"
 }