From 78503c2d2a1d1de9882647c4feb1899694dc7a07 Mon Sep 17 00:00:00 2001 From: Suresh Prakash Date: Mon, 16 Sep 2024 13:10:12 +0530 Subject: [PATCH] Test for builder and getter --- .../model/config/MongoConnectionConfigTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/document-store/src/test/java/org/hypertrace/core/documentstore/model/config/MongoConnectionConfigTest.java b/document-store/src/test/java/org/hypertrace/core/documentstore/model/config/MongoConnectionConfigTest.java index cbdbcaf0..8e85f40f 100644 --- a/document-store/src/test/java/org/hypertrace/core/documentstore/model/config/MongoConnectionConfigTest.java +++ b/document-store/src/test/java/org/hypertrace/core/documentstore/model/config/MongoConnectionConfigTest.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; import org.hypertrace.core.documentstore.model.config.mongo.MongoConnectionConfig; +import org.hypertrace.core.documentstore.model.options.DataFreshness; import org.junit.jupiter.api.Test; class MongoConnectionConfigTest { @@ -167,4 +168,16 @@ void testDefaultCredentials_shouldNotSetCredentials() { final MongoClientSettings actual = mongoConnectionConfig.toSettings(); assertEquals(expected, actual); } + + @Test + void testBuildWithDataFreshnessOption() { + final MongoConnectionConfig mongoConnectionConfig = + (MongoConnectionConfig) + ConnectionConfig.builder() + .type(DatabaseType.MONGO) + .dataFreshness(DataFreshness.NEAR_REALTIME_FRESHNESS) + .build(); + + assertEquals(DataFreshness.NEAR_REALTIME_FRESHNESS, mongoConnectionConfig.dataFreshness()); + } }