From bc867b32c9ecb9218a0a349f99f7ff2111619157 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 5 Sep 2023 23:10:55 +0200 Subject: [PATCH] refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code --- application.yml | 11 +++++++ mongo.sh | 3 ++ .../resources/data/mongodb/messageTo.json | 31 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 application.yml create mode 100644 mongo.sh create mode 100644 src/test/resources/data/mongodb/messageTo.json diff --git a/application.yml b/application.yml new file mode 100644 index 00000000..fe481b26 --- /dev/null +++ b/application.yml @@ -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 index 00000000..ec555ac3 --- /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 index 00000000..ae150343 --- /dev/null +++ b/src/test/resources/data/mongodb/messageTo.json @@ -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" +} -- 2.20.1