aldettinger commented on code in PR #7009:
URL: https://github.com/apache/camel-quarkus/pull/7009#discussion_r1958497278


##########
integration-test-groups/azure/azure-key-vault/src/test/java/org/apache/camel/quarkus/component/azure/key/vault/it/AbstractAzureKeyVaultContextReloadTest.java:
##########
@@ -81,44 +82,49 @@ void contextReload() {
                 EventData eventData = new 
EventData(generateRefreshEvent(secretName).getBytes());
                 List<EventData> finalEventData = new LinkedList<>();
                 finalEventData.add(eventData);
+                LOG.info("Sending refresh event.");
                 client.send(finalEventData);
             } catch (Exception e) {
                 LOG.info("Failed to send a refresh message", e);
             }
 
             //await context reload
-            Awaitility.await().pollInterval(10, TimeUnit.SECONDS).atMost(1, 
TimeUnit.MINUTES).untilAsserted(
+            Awaitility.await().pollInterval(10, TimeUnit.SECONDS).atMost(2, 
TimeUnit.MINUTES).untilAsserted(
                     () -> {
                         RestAssured.get("/azure-key-vault/context/reload")
                                 .then()
                                 .statusCode(200)
                                 .body(CoreMatchers.is("true"));
                     });
+            reloadDetected = true;
         } finally {
 
-            //move cursor of events to ignore old ones (old events are deleted 
after 1 hour)
-            try {
-                String connectionString = 
System.getenv(AZURE_VAULT_EVENT_HUBS_CONNECTION_STRING);
-                String consumerGroup = 
EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME;
-
-                try (EventHubConsumerAsyncClient consumer = new 
EventHubClientBuilder()
-                        .connectionString(connectionString)
-                        .consumerGroup(consumerGroup)
-                        .buildAsyncConsumerClient()) {
-
-                    // Move consumer to the latest position, skipping old 
messages
-                    consumer.receiveFromPartition("0", EventPosition.latest())
-                            .subscribe(event -> {
-                                System.out.println("Processing new event: " + 
event.toString());
-                            }, error -> {
-                                System.err.println("Error receiving events: " 
+ error);
-                            });
-                }
-            } catch (Exception e) {
-                LOG.info("Failed to clear event hub.", e);
-            }
-
-            AzureKeyVaultUtil.deleteSecretImmediately(secretName);
+            //            following code marks events in the hu as read, which 
might be handy for developers

Review Comment:
   Ok got it :+1: 



-- 
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-unsubscr...@camel.apache.org

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

Reply via email to