You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lburgazzoli (via GitHub)" <gi...@apache.org> on 2024/02/22 11:37:05 UTC
[PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
lburgazzoli opened a new pull request, #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792
<!-- Uncomment and fill this section if your PR is not trivial
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
-->
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#discussion_r1499147324
##########
integration-tests/camel-k-runtime-model-reifier/src/test/java/org/apache/camel/quarkus/k/it/WithRoutesOverridesTest.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.quarkus.k.it;
+
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.path.json.JsonPath;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.util.CollectionHelper;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+@QuarkusTestResource(WithRoutesOverridesTest.Resources.class)
+public class WithRoutesOverridesTest {
+
+ @ParameterizedTest
+ @CsvSource({
+ "r1,direct://r1override",
+ "r2,direct://r2",
+ "r3,direct://r3",
+ "r4,direct://r4override",
+ "r5,direct://r5override",
+ })
+ public void overrides(String id, String expected) {
+ JsonPath p = given()
+ .accept(MediaType.APPLICATION_JSON)
+ .get("/camel-k/inspect/route/" + id)
+ .then()
+ .statusCode(200)
+ .extract()
+ .body()
+ .jsonPath();
+
+ assertThat(p.getString("id"))
+ .isEqualTo(id);
+ assertThat(p.getString("input"))
+ .isEqualTo(expected);
+ }
+
+ public static class Resources implements QuarkusTestResourceLifecycleManager {
+ @Override
+ public Map<String, String> start() {
+ return CollectionHelper.mapOf(
+ "camel.k.routes.overrides[0].input.from", "direct:r1",
+ "camel.k.routes.overrides[0].input.with", "direct:r1override",
+ "camel.k.routes.overrides[1].id", "r2invalid",
+ "camel.k.routes.overrides[1].input.from", "direct:r2",
+ "camel.k.routes.overrides[1].input.with", "direct:r2override",
+ "camel.k.routes.overrides[2].id", "r3",
+ "camel.k.routes.overrides[2].input.from", "direct:r3invalid",
+ "camel.k.routes.overrides[2].input.with", "direct:r3override",
+ "camel.k.routes.overrides[3].id", "r4",
+ "camel.k.routes.overrides[3].input.from", "direct:r4",
+ "camel.k.routes.overrides[3].input.with", "direct:r4override",
+ "camel.k.routes.overrides[4].input.with", "direct:r5invalid",
+ "camel.k.routes.overrides[5].id", "r5",
+ "camel.k.routes.overrides[5].input.with", "direct:r5override",
+ "camel.k.sources[0].location", "file:src/test/resources/routes.yaml",
Review Comment:
moved to classpath reolver, would that work on Quarkus Platform @jamesnetherton ?
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#issuecomment-1959778983
> @jamesnetherton should I backport ?
oh you did it already
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#issuecomment-1959775966
@jamesnetherton should I backport ?
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton merged PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on code in PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#discussion_r1499121972
##########
integration-tests/camel-k-runtime-model-reifier/src/test/resources/conf.properties:
##########
@@ -0,0 +1,16 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
Review Comment:
Do we need the empty file?
##########
integration-tests/camel-k-runtime-model-reifier/src/test/java/org/apache/camel/quarkus/k/it/WithRoutesOverridesTest.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.quarkus.k.it;
+
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.path.json.JsonPath;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.util.CollectionHelper;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+@QuarkusTestResource(WithRoutesOverridesTest.Resources.class)
+public class WithRoutesOverridesTest {
+
+ @ParameterizedTest
+ @CsvSource({
+ "r1,direct://r1override",
+ "r2,direct://r2",
+ "r3,direct://r3",
+ "r4,direct://r4override",
+ "r5,direct://r5override",
+ })
+ public void overrides(String id, String expected) {
+ JsonPath p = given()
+ .accept(MediaType.APPLICATION_JSON)
+ .get("/camel-k/inspect/route/" + id)
+ .then()
+ .statusCode(200)
+ .extract()
+ .body()
+ .jsonPath();
+
+ assertThat(p.getString("id"))
+ .isEqualTo(id);
+ assertThat(p.getString("input"))
+ .isEqualTo(expected);
+ }
+
+ public static class Resources implements QuarkusTestResourceLifecycleManager {
+ @Override
+ public Map<String, String> start() {
+ return CollectionHelper.mapOf(
+ "camel.k.routes.overrides[0].input.from", "direct:r1",
+ "camel.k.routes.overrides[0].input.with", "direct:r1override",
+ "camel.k.routes.overrides[1].id", "r2invalid",
+ "camel.k.routes.overrides[1].input.from", "direct:r2",
+ "camel.k.routes.overrides[1].input.with", "direct:r2override",
+ "camel.k.routes.overrides[2].id", "r3",
+ "camel.k.routes.overrides[2].input.from", "direct:r3invalid",
+ "camel.k.routes.overrides[2].input.with", "direct:r3override",
+ "camel.k.routes.overrides[3].id", "r4",
+ "camel.k.routes.overrides[3].input.from", "direct:r4",
+ "camel.k.routes.overrides[3].input.with", "direct:r4override",
+ "camel.k.routes.overrides[4].input.with", "direct:r5invalid",
+ "camel.k.routes.overrides[5].id", "r5",
+ "camel.k.routes.overrides[5].input.with", "direct:r5override",
+ "camel.k.sources[0].location", "file:src/test/resources/routes.yaml",
Review Comment:
`file:src/test/resources/routes.yaml` wont work when the test is run in the Quarkus Platform since the test is run from the test-jar. Better to copy any required resources into `target` or a temporary location.
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#issuecomment-1959329681
> I guess we'd want this backported to 3.8.x?
if that is not an issue, yes
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#issuecomment-1959269981
@davsclaus mind having a look ?
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#discussion_r1499146781
##########
integration-tests/camel-k-runtime-model-reifier/src/test/resources/conf.properties:
##########
@@ -0,0 +1,16 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
Review Comment:
done
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#discussion_r1499136943
##########
integration-tests/camel-k-runtime-model-reifier/src/test/java/org/apache/camel/quarkus/k/it/WithRoutesOverridesTest.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.quarkus.k.it;
+
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.path.json.JsonPath;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.util.CollectionHelper;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+@QuarkusTestResource(WithRoutesOverridesTest.Resources.class)
+public class WithRoutesOverridesTest {
+
+ @ParameterizedTest
+ @CsvSource({
+ "r1,direct://r1override",
+ "r2,direct://r2",
+ "r3,direct://r3",
+ "r4,direct://r4override",
+ "r5,direct://r5override",
+ })
+ public void overrides(String id, String expected) {
+ JsonPath p = given()
+ .accept(MediaType.APPLICATION_JSON)
+ .get("/camel-k/inspect/route/" + id)
+ .then()
+ .statusCode(200)
+ .extract()
+ .body()
+ .jsonPath();
+
+ assertThat(p.getString("id"))
+ .isEqualTo(id);
+ assertThat(p.getString("input"))
+ .isEqualTo(expected);
+ }
+
+ public static class Resources implements QuarkusTestResourceLifecycleManager {
+ @Override
+ public Map<String, String> start() {
+ return CollectionHelper.mapOf(
+ "camel.k.routes.overrides[0].input.from", "direct:r1",
+ "camel.k.routes.overrides[0].input.with", "direct:r1override",
+ "camel.k.routes.overrides[1].id", "r2invalid",
+ "camel.k.routes.overrides[1].input.from", "direct:r2",
+ "camel.k.routes.overrides[1].input.with", "direct:r2override",
+ "camel.k.routes.overrides[2].id", "r3",
+ "camel.k.routes.overrides[2].input.from", "direct:r3invalid",
+ "camel.k.routes.overrides[2].input.with", "direct:r3override",
+ "camel.k.routes.overrides[3].id", "r4",
+ "camel.k.routes.overrides[3].input.from", "direct:r4",
+ "camel.k.routes.overrides[3].input.with", "direct:r4override",
+ "camel.k.routes.overrides[4].input.with", "direct:r5invalid",
+ "camel.k.routes.overrides[5].id", "r5",
+ "camel.k.routes.overrides[5].input.with", "direct:r5override",
+ "camel.k.sources[0].location", "file:src/test/resources/routes.yaml",
Review Comment:
let me fix that
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#issuecomment-1959328478
I guess we'd want this backported to 4.4.x?
--
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
Re: [PR] feat(camel-k): add options to override some aspects of a route [camel-quarkus]
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on code in PR #5792:
URL: https://github.com/apache/camel-quarkus/pull/5792#discussion_r1499466173
##########
integration-tests/camel-k-runtime-model-reifier/src/test/java/org/apache/camel/quarkus/k/it/WithRoutesOverridesTest.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.quarkus.k.it;
+
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.path.json.JsonPath;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.util.CollectionHelper;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+@QuarkusTestResource(WithRoutesOverridesTest.Resources.class)
+public class WithRoutesOverridesTest {
+
+ @ParameterizedTest
+ @CsvSource({
+ "r1,direct://r1override",
+ "r2,direct://r2",
+ "r3,direct://r3",
+ "r4,direct://r4override",
+ "r5,direct://r5override",
+ })
+ public void overrides(String id, String expected) {
+ JsonPath p = given()
+ .accept(MediaType.APPLICATION_JSON)
+ .get("/camel-k/inspect/route/" + id)
+ .then()
+ .statusCode(200)
+ .extract()
+ .body()
+ .jsonPath();
+
+ assertThat(p.getString("id"))
+ .isEqualTo(id);
+ assertThat(p.getString("input"))
+ .isEqualTo(expected);
+ }
+
+ public static class Resources implements QuarkusTestResourceLifecycleManager {
+ @Override
+ public Map<String, String> start() {
+ return CollectionHelper.mapOf(
+ "camel.k.routes.overrides[0].input.from", "direct:r1",
+ "camel.k.routes.overrides[0].input.with", "direct:r1override",
+ "camel.k.routes.overrides[1].id", "r2invalid",
+ "camel.k.routes.overrides[1].input.from", "direct:r2",
+ "camel.k.routes.overrides[1].input.with", "direct:r2override",
+ "camel.k.routes.overrides[2].id", "r3",
+ "camel.k.routes.overrides[2].input.from", "direct:r3invalid",
+ "camel.k.routes.overrides[2].input.with", "direct:r3override",
+ "camel.k.routes.overrides[3].id", "r4",
+ "camel.k.routes.overrides[3].input.from", "direct:r4",
+ "camel.k.routes.overrides[3].input.with", "direct:r4override",
+ "camel.k.routes.overrides[4].input.with", "direct:r5invalid",
+ "camel.k.routes.overrides[5].id", "r5",
+ "camel.k.routes.overrides[5].input.with", "direct:r5override",
+ "camel.k.sources[0].location", "file:src/test/resources/routes.yaml",
Review Comment:
Yeah it should be ok
--
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