davsclaus commented on code in PR #30554:
URL: https://github.com/apache/camel/pull/30554#discussion_r4652526165


##########
components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/SslAwareMongoClientTest.java:
##########
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mongodb;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.mongodb.MongoClientSettings;
+import com.mongodb.MongoCredential;
+import com.mongodb.ReadPreference;
+import com.mongodb.ServerAddress;
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.PropertyBindingSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;

Review Comment:
   Done in 4120ac475c88: JUnit assertions (`assertEquals`, `assertArrayEquals`, 
`assertThrows`). Small correction: the module was not AssertJ-free 
(`MongoDbEndpointClientOptionsTest` and `MongoDbClientOptionsIT` from 
CAMEL-27193 use it), but 44 of its test files use JUnit assertions, so matching 
that is right.
   
   _Claude Code on behalf of Claus Ibsen_



##########
components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/integration/SslAwareMongoClientIT.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mongodb.integration;
+
+import com.mongodb.MongoSecurityException;
+import com.mongodb.ReadPreference;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.mongodb.MongoDbEndpoint;
+import org.apache.camel.component.mongodb.SslAwareMongoClient;
+import org.apache.camel.test.infra.core.annotations.ContextFixture;
+import org.bson.Document;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;

Review Comment:
   Done in 4120ac475c88 as well.
   
   _Claude Code on behalf of Claus Ibsen_



##########
components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/SslAwareMongoClient.java:
##########
@@ -101,6 +77,51 @@ public MongoClient get() {
     private boolean ssl = true;
 
     private boolean sslValidationEnabled = true;
+    private String readPreference;
+
+    /**
+     * The settings of the client: the hosts, the credentials (authenticated 
against the admin database), TLS and the
+     * read preference.
+     */
+    MongoClientSettings createSettings() {

Review Comment:
   Done in 4120ac475c88: the Javadoc now says it is package-private so the unit 
tests can check the settings without creating a client.
   
   _Claude Code on behalf of Claus Ibsen_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to