Skip to content

Commit fbd8d2f

Browse files
committed
Add directConnection URI option assertion to SRV+directConnection=false test
JAVA-3755
1 parent df180a1 commit fbd8d2f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

driver-core/src/test/functional/com/mongodb/internal/async/client/InitialDnsSeedlistDiscoveryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ public void clusterDescriptionChanged(final ClusterDescriptionChangedEvent event
151151
// the authSource is ignored. If the test gets this far, at least we know that a TXT record
152152
// containing in authSource doesn't blow up. We just don't test that it's actually used.
153153
assertTrue(true);
154+
} else if (entry.getKey().equals("directConnection")) {
155+
assertEquals(entry.getValue().asBoolean().getValue(), connectionString.isDirectConnection());
154156
} else {
155157
throw new UnsupportedOperationException("No support configured yet for " + entry.getKey());
156158
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost:27017",
8+
"localhost:27018",
9+
"localhost:27019"
10+
],
11+
"options": {
12+
"ssl": true,
13+
"directConnection": false
14+
}
15+
}

driver-sync/src/test/functional/com/mongodb/client/InitialDnsSeedlistDiscoveryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public void clusterDescriptionChanged(final ClusterDescriptionChangedEvent event
145145
// the authSource is ignored. If the test gets this far, at least we know that a TXT record
146146
// containing in authSource doesn't blow up. We just don't test that it's actually used.
147147
assertTrue(true);
148+
} else if (entry.getKey().equals("directConnection")) {
149+
assertEquals(entry.getValue().asBoolean().getValue(), connectionString.isDirectConnection());
148150
} else {
149151
throw new UnsupportedOperationException("No support configured yet for " + entry.getKey());
150152
}

0 commit comments

Comments
 (0)