You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "LostArtist (via GitHub)" <gi...@apache.org> on 2023/08/03 14:05:45 UTC

[GitHub] [camel] LostArtist opened a new pull request, #10981: CAMEL-19647: use 503 for health check DOWN

LostArtist opened a new pull request, #10981:
URL: https://github.com/apache/camel/pull/10981

   - Added unity test to verify changes 
   


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


[GitHub] [camel] orpiske commented on a diff in pull request #10981: CAMEL-19647: use 503 for health check DOWN

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #10981:
URL: https://github.com/apache/camel/pull/10981#discussion_r1283265301


##########
components/camel-platform-http-main/src/test/java/org/apache/camel/component/platform/http/main/MainHttpServerTest.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * 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.platform.http.main;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class MainHttpServerTest {
+
+    private CamelContext camelContext;
+
+    @Test
+    public void statusIsNotSatisfied() throws IOException, InterruptedException {
+        MainHttpServer server = new MainHttpServer();
+
+        camelContext = new DefaultCamelContext();
+        server.setCamelContext(camelContext);
+
+        camelContext.getRegistry().bind("fake", new MainHttpFakeHealthCheck());
+
+        server.setHost("0.0.0.0");
+        server.setPort(8080);
+        server.setPath("/");
+
+        server.setHealthCheckEnabled(true);
+        server.start();
+
+        HttpRequest request = HttpRequest.newBuilder()
+                .uri(URI.create("http://localhost:8080/q/health/ready"))

Review Comment:
   And we'll need to adjust here once we use the `AvailablePortFinder`.



##########
components/camel-platform-http-main/src/test/java/org/apache/camel/component/platform/http/main/MainHttpServerTest.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * 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.platform.http.main;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class MainHttpServerTest {
+
+    private CamelContext camelContext;
+
+    @Test
+    public void statusIsNotSatisfied() throws IOException, InterruptedException {
+        MainHttpServer server = new MainHttpServer();
+
+        camelContext = new DefaultCamelContext();
+        server.setCamelContext(camelContext);
+
+        camelContext.getRegistry().bind("fake", new MainHttpFakeHealthCheck());
+
+        server.setHost("0.0.0.0");
+        server.setPort(8080);

Review Comment:
   An oversight on my part: we could probably have used the `AvailablePortFinder`. 



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


[GitHub] [camel] github-actions[bot] commented on pull request #10981: CAMEL-19647: use 503 for health check DOWN

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10981:
URL: https://github.com/apache/camel/pull/10981#issuecomment-1664047788

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   :robot: Use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


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


[GitHub] [camel] orpiske commented on pull request #10981: CAMEL-19647: use 503 for health check DOWN

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #10981:
URL: https://github.com/apache/camel/pull/10981#issuecomment-1667895974

   I'll fix the UT separately in this case - we need this patch for GA.


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


[GitHub] [camel] orpiske merged pull request #10981: CAMEL-19647: use 503 for health check DOWN

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #10981:
URL: https://github.com/apache/camel/pull/10981


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