Skip to content

Commit bc43ba0

Browse files
committed
Skip tests when auth is enabled.
JAVA-5870
1 parent 179b262 commit bc43ba0

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MongoClient.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ public interface MongoClient extends MongoCluster, Closeable {
6060
*/
6161
ClusterDescription getClusterDescription();
6262

63-
63+
/**
64+
* Updates the {@link MongoClient} metadata by appending the provided {@link MongoDriverInformation}
65+
* to the existing metadata.
66+
* <p>
67+
* This enables frameworks and libraries to include identifying metadata (e.g., name, version, platform) which might be visible in
68+
* the MongoD/MongoS logs. This can assist with diagnostics by making client identity visible to the server.
69+
* <p>
70+
* <strong>Note:</strong> Metadata is limited to 512 bytes; any excess will be truncated.
71+
*
72+
* @param mongoDriverInformation the driver information to append to the existing metadata
73+
* @since 5.6
74+
*/
6475
void updateMetadata(MongoDriverInformation mongoDriverInformation);
6576
}

driver-sync/src/main/com/mongodb/client/MongoClient.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,17 @@ public interface MongoClient extends MongoCluster, Closeable {
6363
*/
6464
ClusterDescription getClusterDescription();
6565

66+
/**
67+
* Updates the {@link MongoClient} metadata by appending the provided {@link MongoDriverInformation}
68+
* to the existing metadata.
69+
* <p>
70+
* This enables frameworks and libraries to include identifying metadata (e.g., name, version, platform) which might be visible in
71+
* the MongoD/MongoS logs. This can assist with diagnostics by making client identity visible to the server.
72+
* <p>
73+
* <strong>Note:</strong> Metadata is limited to 512 bytes; any excess will be truncated.
74+
*
75+
* @param mongoDriverInformation the driver information to append to the existing metadata
76+
* @since 5.6
77+
*/
6678
void updateMetadata(MongoDriverInformation mongoDriverInformation);
6779
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.mongodb.client;
1818

19-
import com.mongodb.ClusterFixture;
2019
import com.mongodb.MongoClientSettings;
2120
import com.mongodb.MongoDriverInformation;
2221
import com.mongodb.event.CommandStartedEvent;
@@ -34,6 +33,8 @@
3433
import java.util.Optional;
3534
import java.util.concurrent.TimeUnit;
3635

36+
import static com.mongodb.ClusterFixture.isAuthenticated;
37+
import static com.mongodb.ClusterFixture.isLoadBalanced;
3738
import static com.mongodb.ClusterFixture.sleep;
3839
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
3940
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -52,7 +53,8 @@ protected abstract MongoClient createMongoClient(@Nullable MongoDriverInformatio
5253

5354
@BeforeEach
5455
public void setUp() {
55-
assumeFalse(ClusterFixture.isLoadBalanced());
56+
assumeFalse(isLoadBalanced());
57+
assumeFalse(isAuthenticated());
5658

5759
commandListener = new TestCommandListener();
5860
connectionPoolListener = new TestConnectionPoolListener();

0 commit comments

Comments
 (0)