gnodet-bot commented on code in PR #29151:
URL: https://github.com/apache/camel/pull/29151#discussion_r4468493001
##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/DevModeITCase.java:
##########
@@ -92,10 +94,20 @@ public void testDeleteFileViaHttp() throws IOException {
copyResourceInDataFolder(TestResources.DIR_ROUTE);
executeBackground(String.format("run --dev --console --source-dir=%s",
mountPoint()));
checkLogContains("Hello world!");
+ Awaitility.await("route1 running before delete")
+ .atMost(ASSERTION_WAIT_SECONDS, TimeUnit.SECONDS)
Review Comment:
🔧 **Nit:** Use `Duration.ofSeconds(ASSERTION_WAIT_SECONDS)` to match the
convention in this module.
```suggestion
.atMost(Duration.ofSeconds(ASSERTION_WAIT_SECONDS))
```
##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/DevModeITCase.java:
##########
@@ -92,10 +94,20 @@ public void testDeleteFileViaHttp() throws IOException {
copyResourceInDataFolder(TestResources.DIR_ROUTE);
executeBackground(String.format("run --dev --console --source-dir=%s",
mountPoint()));
checkLogContains("Hello world!");
+ Awaitility.await("route1 running before delete")
+ .atMost(ASSERTION_WAIT_SECONDS, TimeUnit.SECONDS)
+ .untilAsserted(() -> Assertions.assertThat(execute("get
route"))
+ .as("route1 should be running before the DELETE")
+ .contains("route1"));
execInHost(String.format(
"curl -X DELETE
http://localhost:%s/q/upload/FromDirectoryRoute.java",
containerService.getDevConsolePort()));
- checkLogContains("FromDirectoryRoute.java does not exist");
+ checkLogContains("Deleting file:");
+ Awaitility.await("route removed after file deletion")
+ .atMost(ASSERTION_WAIT_SECONDS, TimeUnit.SECONDS)
Review Comment:
🔧 **Nit:** Same as above — use `Duration.ofSeconds(ASSERTION_WAIT_SECONDS)`.
```suggestion
.atMost(Duration.ofSeconds(ASSERTION_WAIT_SECONDS))
```
##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/DevModeITCase.java:
##########
@@ -25,12 +25,14 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
+import java.util.concurrent.TimeUnit;
Review Comment:
🔧 **Nit:** `java.time.Duration` is already imported (line 27) and used
throughout this module. `TimeUnit` can be dropped; use
`Duration.ofSeconds(ASSERTION_WAIT_SECONDS)` in both `atMost` calls instead
(see `InfrastructureITCase`, `RunCommandITCase`).
```suggestion
```
--
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]