refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code
authorKai Moritz <kai@juplo.de>
Tue, 5 Sep 2023 21:10:55 +0000 (23:10 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 5 Sep 2023 21:10:55 +0000 (23:10 +0200)
application.yml [new file with mode: 0644]
mongo.sh [new file with mode: 0644]
src/test/resources/data/mongodb/messageTo.json [new file with mode: 0644]

diff --git a/application.yml b/application.yml
new file mode 100644 (file)
index 0000000..fe481b2
--- /dev/null
@@ -0,0 +1,11 @@
+chat:
+  backend:
+    services: inmemory
+    inmemory:
+      storage-strategy: mongodb
+spring:
+  data:
+    mongodb:
+      host: localhost
+      port: 27017
+      database: test
diff --git a/mongo.sh b/mongo.sh
new file mode 100644 (file)
index 0000000..ec555ac
--- /dev/null
+++ b/mongo.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+docker run --rm --name mongo -p 27017:27017 -v $(pwd)/src/test/resources/data/mongodb:/docker-entrypoint-initdb.d mongo:6
+
diff --git a/src/test/resources/data/mongodb/messageTo.json b/src/test/resources/data/mongodb/messageTo.json
new file mode 100644 (file)
index 0000000..ae15034
--- /dev/null
@@ -0,0 +1,31 @@
+{
+  "_id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7",
+  "name": "FOO",
+  "messages": [
+    {
+      "_id": "peter--1",
+      "serial": 0,
+      "time": "2023-01-13T20:43:16.803382151",
+      "text": "Hallo, ich heiße Peter!"
+    },
+    {
+      "_id": "ute--1",
+      "serial": 1,
+      "time": "2023-01-13T20:43:16.804049969",
+      "text": "Ich bin Ute..."
+    },
+    {
+      "_id": "peter--2",
+      "serial": 2,
+      "time": "2023-01-13T20:43:16.804092782",
+      "text": "Willst du mit mir gehen?"
+    },
+    {
+      "_id": "klaus--1",
+      "serial": 3,
+      "time": "2023-01-13T20:43:16.804122604",
+      "text": "Ja? Nein? Vielleicht??"
+    }
+  ],
+  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.ChatRoomTo"
+}