gnodet-bot commented on code in PR #29083:
URL: https://github.com/apache/camel/pull/29083#discussion_r4665340116


##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/InfraAdvancedITCase.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.dsl.jbang.it;
+
+import java.time.Duration;
+
+import org.apache.camel.dsl.jbang.it.support.JBangTestSupport;
+import org.apache.camel.util.StringHelper;
+import org.assertj.core.api.Assertions;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+import org.junit.jupiter.api.condition.DisabledOnOs;
+
+import static org.junit.jupiter.api.condition.OS.WINDOWS;
+
+@Tag("container-only")
+@DisabledOnOs(WINDOWS)
+@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", 
disabledReason = "Requires too much resources")
+public class InfraAdvancedITCase extends JBangTestSupport {
+
+    private static final String SERVICE = "ftp";
+
+    @AfterEach
+    public void stopInfraService() {
+        execInContainer(getMainCommand() + " infra stop " + SERVICE + " || 
true");
+    }
+
+    private String getServicePID(String message) {
+        Assertions.assertThat(message)
+                .as("infra run/restart --background output should contain 
'PID:'")
+                .contains("PID:");
+        // afterLast picks the last "PID:" in the output, which is always the 
new process when
+        // infra restart prints both a "Stopping (PID: old)" and a "Running 
... PID: new" line.
+        return StringHelper.afterLast(message, 
"PID:").trim().replaceAll("[^0-9]", "");
+    }
+
+    @Test
+    public void testInfraGet() {
+        String msg = execute("infra run --background " + SERVICE);
+        String PID = getServicePID(msg);

Review Comment:
   💡 **Nit:** `PID` is a local variable — Java convention reserves `ALL_CAPS` 
for `static final` constants. `pid` matches the naming in other test methods in 
this class (e.g. `CmdChaosITCase`).



-- 
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