@@ -108,4 +108,24 @@ func TestReplicaSetWithConnectionString(t *testing.T) {
108
108
tester .ConnectivityRejected (ctx , WithURI (mongodbtests .GetSrvConnectionStringForUser (ctx , mdb , scramUser ))))
109
109
})
110
110
111
+ /**
112
+ Connection String Annotations options.
113
+ */
114
+ t .Run ("Connection String With Annotations" , func (t * testing.T ) {
115
+ t .Run ("Resetting Connection String Options" , mongodbtests .ResetConnectionStringOptions (ctx , & mdb ))
116
+ t .Run ("Test Add New Connection String Annotations to Resource" , mongodbtests .AddConnectionStringAnnotationsToUser (ctx , & mdb , map [string ]string {"mongodbcommunity.mongodb.com/test-annotation" : "test-value" }))
117
+ t .Run ("Test Secrets Are Updated" , mongodbtests .MongoDBReachesRunningPhase (ctx , & mdb ))
118
+
119
+ scramUser = mdb .GetAuthUsers ()[0 ]
120
+ t .Run ("Test Basic Connectivity" , tester .ConnectivitySucceeds ())
121
+ t .Run ("Test SRV Connectivity" , tester .ConnectivitySucceeds (WithURI (mdb .MongoSRVURI ("" )), WithoutTls (), WithReplicaSet (mdb .Name )))
122
+ t .Run ("Test Basic Connectivity with generated connection string secret" ,
123
+ tester .ConnectivitySucceeds (WithURI (mongodbtests .GetConnectionStringForUser (ctx , mdb , scramUser ))))
124
+ t .Run ("Test SRV Connectivity with generated connection string secret" ,
125
+ tester .ConnectivitySucceeds (WithURI (mongodbtests .GetSrvConnectionStringForUser (ctx , mdb , scramUser ))))
126
+
127
+ ownerRef := mdb .GetOwnerReferences ()[0 ]
128
+ t .Run ("Test Connection String Annotations are as expected" , mongodbtests .ConnectionStringSecretsAreConfigured (ctx , & mdb , ownerRef ))
129
+ })
130
+
111
131
}
0 commit comments