<properties>
<java.version>17</java.version>
<assertj-reactor.version>1.0.8</assertj-reactor.version>
+ <mongodb.version>4.7.2</mongodb.version>
</properties>
<dependencyManagement>
<dependencies>
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
+import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
@Setter(AccessLevel.PACKAGE)
@EqualsAndHashCode(of = { "id" })
@ToString(of = { "id", "name" })
+@Document
public class ChatRoomTo
{
@Id
import de.juplo.kafka.chat.backend.domain.Message;
import lombok.*;
+import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;
import java.util.regex.Matcher;
@Setter(AccessLevel.PACKAGE)
@EqualsAndHashCode(of = { "user", "id" })
@ToString(of = { "user", "id" })
+@Document
class MessageTo
{
final static Pattern SPLIT_ID = Pattern.compile("^([a-z-]+)--([0-9]+)$");
@Container
private static final GenericContainer CONTAINER =
new GenericContainer("mongo:6")
- .withEnv("MONGO_INITDB_ROOT_USERNAME", "mongo")
- .withEnv("MONGO_INITDB_ROOT_PASSWORD", "mongo")
.withEnv("MONGO_INITDB_DATABASE", "test")
.withExposedPorts(MONGODB_PORT);
applicationContext,
"spring.data.mongodb.host=localhost",
"spring.data.mongodb.port=" + CONTAINER.getMappedPort(MONGODB_PORT),
- "spring.data.mongodb.username=mongo",
- "spring.data.mongodb.password=mongo",
"spring.data.mongodb.database=test");
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log);