Skip to content

Commit

Permalink
Test for builder and getter
Browse files Browse the repository at this point in the history
  • Loading branch information
suresh-prakash committed Sep 16, 2024
1 parent 21b8783 commit 78503c2
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 78503c2

Please sign in to comment.