From: Kai Moritz Date: Tue, 5 Sep 2023 21:10:55 +0000 (+0200) Subject: refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code X-Git-Tag: rebase--2023-09-05--23-53~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=bc867b32c9ecb9218a0a349f99f7ff2111619157;p=demos%2Fkafka%2Fchat refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code --- 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" +}