From 1a340f32e285dff91eed73cfc1c1a2a55a4a3cd9 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 3 Sep 2023 19:49:59 +0200 Subject: [PATCH] refactor: Splitted `ChatRoomInfo` and `ChatRoomData` - Moved classes --- .../domain/{ChatRoom.java => ChatRoomData.java} | 10 +++------- .../{ChatRoomTest.java => ChatRoomDataTest.java} | 0 2 files changed, 3 insertions(+), 7 deletions(-) rename src/main/java/de/juplo/kafka/chat/backend/domain/{ChatRoom.java => ChatRoomData.java} (92%) rename src/test/java/de/juplo/kafka/chat/backend/domain/{ChatRoomTest.java => ChatRoomDataTest.java} (100%) diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomData.java similarity index 92% rename from src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java rename to src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomData.java index c66b887d..873e58e7 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomData.java @@ -8,15 +8,15 @@ import reactor.core.publisher.SynchronousSink; import java.time.Clock; import java.time.LocalDateTime; -import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @Slf4j -public class ChatRoom extends ChatRoomInfo +public class ChatRoom { public final static Pattern VALID_USER = Pattern.compile("^[a-z0-9-]{2,}$"); + private final Clock clock; private final ChatRoomService service; private final int bufferSize; @@ -24,15 +24,11 @@ public class ChatRoom extends ChatRoomInfo public ChatRoom( - UUID id, - String name, - Integer shard, Clock clock, ChatRoomService service, int bufferSize) { - super(id, name, shard); - log.info("Created ChatRoom {} with buffer-size {}", id, bufferSize); + log.info("Created ChatRoom with buffer-size {}", bufferSize); this.clock = clock; this.service = service; this.bufferSize = bufferSize; diff --git a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomTest.java b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomDataTest.java similarity index 100% rename from src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomTest.java rename to src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomDataTest.java -- 2.20.1