You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/04/14 15:50:29 UTC

[GitHub] [camel-quarkus] zhfeng commented on a diff in pull request #3731: Fix #3730 improve paho-mqtt5 ssl tests

zhfeng commented on code in PR #3731:
URL: https://github.com/apache/camel-quarkus/pull/3731#discussion_r850580608


##########
integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java:
##########
@@ -68,13 +70,17 @@ public class PahoMqtt5Resource {
     public String consumePahoMessage(
             @PathParam("protocol") String protocol,
             @PathParam("queueName") String queueName) {
+        String tmpKeystore = null;
+
         if ("ssl".equals(protocol)) {
-            setKeyStore(keystore, password);
+            tmpKeystore = setKeyStore(keystore, password);
         }
+
         String result = consumerTemplate.receiveBody("paho-mqtt5:" + queueName + "?brokerUrl=" + brokerUrl(protocol), 5000,
                 String.class);
-        if ("ssl".equals(protocol)) {
-            removeKeyStore(keystore);
+
+        if ("ssl".equals(protocol) && tmpKeystore != null) {
+            removeKeyStore(tmpKeystore);

Review Comment:
   Well, @jamesnetherton suggest to unset the keystore properties in https://github.com/apache/camel-quarkus/pull/3709#discussion_r845767127 and I think it is reasonable to clean the environment properties after testing. I'm not very sure that surefire always lauchs a new JVM for each test ? e.g. with ```reuseForks=true```



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org