diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java deleted file mode 100644 index c47588cc0be1..000000000000 --- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.core.faulttolerance.it; - -import java.util.concurrent.ExecutorService; - -import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.json.Json; -import jakarta.json.JsonObject; -import jakarta.json.JsonObjectBuilder; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import org.apache.camel.CamelContext; -import org.apache.camel.component.microprofile.faulttolerance.FaultToleranceProcessor; - -@Path("/core") -@ApplicationScoped -public class CoreFaultToleranceResource { - - @Inject - CamelContext context; - - @Named("customCircuitBreaker") - CircuitBreaker customCircuitBreaker; - - @Named("customBulkheadExecutorService") - ExecutorService customBulkheadExecutorService; - - @Path("/fault-tolerance-configurations") - @GET - @Produces(MediaType.APPLICATION_JSON) - public JsonObject faultToleranceConfigurations() { - FaultToleranceProcessor ftp = context.getProcessor("ftp", FaultToleranceProcessor.class); - - JsonObjectBuilder objectBuilder = Json.createObjectBuilder(); - objectBuilder.add("isCustomCircuitBreakerRef", ftp.getCircuitBreaker() == customCircuitBreaker); - objectBuilder.add("delay", ftp.getDelay()); - objectBuilder.add("successThreshold", ftp.getSuccessThreshold()); - objectBuilder.add("requestVolumeThreshold", ftp.getRequestVolumeThreshold()); - objectBuilder.add("failureRatio", (int) (ftp.getFailureRate() * 100)); - objectBuilder.add("timeoutEnabled", ftp.isTimeoutEnabled()); - objectBuilder.add("timeoutDuration", ftp.getTimeoutDuration()); - objectBuilder.add("timeoutPoolSize", ftp.getTimeoutPoolSize()); - objectBuilder.add("bulkheadEnabled", ftp.isBulkheadEnabled()); - objectBuilder.add("bulkheadMaxConcurrentCalls", ftp.getBulkheadMaxConcurrentCalls()); - objectBuilder.add("bulkheadWaitingTaskQueue", ftp.getBulkheadWaitingTaskQueue()); - objectBuilder.add("isCustomBulkheadExecutorServiceRef", ftp.getExecutorService() == customBulkheadExecutorService); - - return objectBuilder.build(); - } -} diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java deleted file mode 100644 index 01e6cfeb0677..000000000000 --- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.core.faulttolerance.it; - -import jakarta.enterprise.context.ApplicationScoped; -import org.apache.camel.builder.RouteBuilder; - -/** - * No message is expected to flow through this route. - * The route definition is there only to test the camel fault tolerance configuration parsing. - */ -@ApplicationScoped -public class CoreFaultToleranceRoutes extends RouteBuilder { - - public static final String FALLBACK_RESULT = "Fallback response"; - public static final String RESULT = "Hello Camel Quarkus Core Fault Tolerance"; - - @Override - public void configure() { - from("direct:faultTolerance").circuitBreaker().id("ftp").process(exchange -> { - exchange.getMessage().setBody(RESULT); - }).onFallback().setBody().constant(FALLBACK_RESULT).end(); - } -} diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties b/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties deleted file mode 100644 index 48c4c9b31509..000000000000 --- a/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties +++ /dev/null @@ -1,27 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -# -# Camel -camel.faulttolerance.circuitBreaker = customCircuitBreaker -camel.faulttolerance.delay = 15 -camel.faulttolerance.successThreshold = 4 -camel.faulttolerance.requestVolumeThreshold = 60 -camel.faulttolerance.failureRatio = 94 -camel.faulttolerance.timeoutEnabled = true -camel.faulttolerance.timeoutDuration = 3000 -camel.faulttolerance.timeoutPoolSize = 3 diff --git a/integration-test-groups/foundation/pom.xml b/integration-test-groups/foundation/pom.xml index 6cfcd5c9fe2f..c08a3f8a38bc 100644 --- a/integration-test-groups/foundation/pom.xml +++ b/integration-test-groups/foundation/pom.xml @@ -39,7 +39,6 @@ controlbus core core-annotations - core-fault-tolerance core-languages core-thread-pools customized-log-component diff --git a/integration-tests/microprofile/pom.xml b/integration-tests/microprofile-fault-tolerance/pom.xml similarity index 78% rename from integration-tests/microprofile/pom.xml rename to integration-tests/microprofile-fault-tolerance/pom.xml index a6bc9c5ea842..811f64d38343 100644 --- a/integration-tests/microprofile/pom.xml +++ b/integration-tests/microprofile-fault-tolerance/pom.xml @@ -26,9 +26,9 @@ ../../poms/build-parent-it/pom.xml - camel-quarkus-integration-test-microprofile - Camel Quarkus :: Integration Tests :: MicroProfile - Integration tests for Camel Quarkus MicroProfile extensions + camel-quarkus-integration-test-microprofile-fault-tolerance + Camel Quarkus :: Integration Tests :: MicroProfile Fault Tolerance + Integration tests for Camel Quarkus MicroProfile Fault Tolerance extension @@ -39,18 +39,10 @@ org.apache.camel.quarkus camel-quarkus-direct - - org.apache.camel.quarkus - camel-quarkus-log - org.apache.camel.quarkus camel-quarkus-microprofile-fault-tolerance - - org.apache.camel.quarkus - camel-quarkus-microprofile-health - org.apache.camel.quarkus camel-quarkus-mock @@ -59,6 +51,10 @@ io.quarkus quarkus-resteasy + + io.quarkus + quarkus-resteasy-jsonb + @@ -71,11 +67,6 @@ rest-assured test - - org.awaitility - awaitility - test - @@ -141,19 +132,6 @@ - - org.apache.camel.quarkus - camel-quarkus-log-deployment - ${project.version} - pom - test - - - * - * - - - org.apache.camel.quarkus camel-quarkus-microprofile-fault-tolerance-deployment @@ -167,19 +145,6 @@ - - org.apache.camel.quarkus - camel-quarkus-microprofile-health-deployment - ${project.version} - pom - test - - - * - * - - - org.apache.camel.quarkus camel-quarkus-mock-deployment diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/GreetingBean.java b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/GreetingBean.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/GreetingBean.java rename to integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/GreetingBean.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceHelper.java b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceHelper.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceHelper.java rename to integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceHelper.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java similarity index 91% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java rename to integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java index 1246acf8d072..d5e5ec91ad62 100644 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java +++ b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java @@ -23,6 +23,7 @@ import jakarta.inject.Inject; import jakarta.inject.Named; import org.apache.camel.builder.RouteBuilder; +import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException; @ApplicationScoped @@ -35,6 +36,9 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder { @Inject GreetingBean greetingBean; + @ConfigProperty(name = "load.config.test.route", defaultValue = "false") + boolean loadConfigTestRoute; + @Override public void configure() throws Exception { from("direct:faultToleranceWithBulkhead") @@ -125,6 +129,13 @@ public void configure() throws Exception { .doCatch(TimeoutException.class) .setBody().constant(FALLBACK_RESULT) .end(); + + if (loadConfigTestRoute) { + // This route exists only to test camel.faulttolerance configuration parsing + from("direct:customConfig").circuitBreaker().id("ftp").process(exchange -> { + exchange.getMessage().setBody(RESULT); + }).onFallback().setBody().constant(FALLBACK_RESULT).end(); + } } @Named("myThreadPool") diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java similarity index 84% rename from integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java rename to integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java index 7b82e4867bd6..ba233c18b583 100644 --- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java +++ b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java @@ -14,14 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.faulttolerance.it; +package org.apache.camel.quarkus.component.microprofile.it.faulttolerance; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import io.smallrye.faulttolerance.core.FaultToleranceStrategy; -import io.smallrye.faulttolerance.core.InvocationContext; import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker; import io.smallrye.faulttolerance.core.stopwatch.SystemStopwatch; import io.smallrye.faulttolerance.core.timer.ThreadTimer; @@ -30,17 +29,13 @@ import jakarta.enterprise.inject.Disposes; import jakarta.inject.Named; -public class CoreFaultToleranceProducers { +@ApplicationScoped +public class MicroprofileFaultToleranceProducers { @ApplicationScoped @Named("customCircuitBreaker") CircuitBreaker produceCustomCircuitBreaker(ThreadTimer threadTimer) { - FaultToleranceStrategy delegate = new FaultToleranceStrategy() { - @Override - public Integer apply(InvocationContext ctx) { - return null; - } - }; + FaultToleranceStrategy delegate = ctx -> null; return new CircuitBreaker<>(delegate, "description", ExceptionDecision.ALWAYS_FAILURE, 10, 40, 0.1, 2, SystemStopwatch.INSTANCE, threadTimer) { @Override @@ -68,7 +63,8 @@ ExecutorService threadTimerExecutor() { return Executors.newSingleThreadExecutor(); } - void disposeThreadTimerExecutor(@Disposes @Named("threadTimerExecutor") ExecutorService threadTimerExecutor, + void disposeThreadTimerExecutor( + @Disposes @Named("threadTimerExecutor") ExecutorService threadTimerExecutor, ThreadTimer timer) { try { timer.shutdown(); diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java similarity index 57% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java rename to integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java index 211dbf98718c..8864a3d751c8 100644 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java +++ b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceResource.java @@ -16,7 +16,15 @@ */ package org.apache.camel.quarkus.component.microprofile.it.faulttolerance; +import java.util.concurrent.ExecutorService; + +import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker; import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.json.Json; +import jakarta.json.JsonObject; +import jakarta.json.JsonObjectBuilder; +import jakarta.ws.rs.GET; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; @@ -24,6 +32,7 @@ import jakarta.ws.rs.core.MediaType; import org.apache.camel.CamelContext; import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.microprofile.faulttolerance.FaultToleranceProcessor; import org.apache.camel.component.mock.MockEndpoint; @Path("/microprofile-fault-tolerance") @@ -35,6 +44,12 @@ public class MicroprofileFaultToleranceResource { @Inject CamelContext context; + @Named("customCircuitBreaker") + CircuitBreaker customCircuitBreaker; + + @Named("customBulkheadExecutorService") + ExecutorService customBulkheadExecutorService; + @Path("/route/{route}") @POST @Produces(MediaType.TEXT_PLAIN) @@ -71,4 +86,27 @@ public void inheritErrorHandler() throws Exception { end.assertIsSatisfied(5000); dead.assertIsSatisfied(5000); } + + @Path("/configuration") + @GET + @Produces(MediaType.APPLICATION_JSON) + public JsonObject faultToleranceConfigurations() { + FaultToleranceProcessor processor = context.getProcessor("ftp", FaultToleranceProcessor.class); + JsonObjectBuilder objectBuilder = Json.createObjectBuilder(); + objectBuilder.add("isCustomCircuitBreakerRef", processor.getCircuitBreaker() == customCircuitBreaker); + objectBuilder.add("delay", processor.getDelay()); + objectBuilder.add("successThreshold", processor.getSuccessThreshold()); + objectBuilder.add("requestVolumeThreshold", processor.getRequestVolumeThreshold()); + objectBuilder.add("failureRatio", (int) (processor.getFailureRate() * 100)); + objectBuilder.add("timeoutEnabled", processor.isTimeoutEnabled()); + objectBuilder.add("timeoutDuration", processor.getTimeoutDuration()); + objectBuilder.add("timeoutPoolSize", processor.getTimeoutPoolSize()); + objectBuilder.add("bulkheadEnabled", processor.isBulkheadEnabled()); + objectBuilder.add("bulkheadMaxConcurrentCalls", processor.getBulkheadMaxConcurrentCalls()); + objectBuilder.add("bulkheadWaitingTaskQueue", processor.getBulkheadWaitingTaskQueue()); + objectBuilder.add("isCustomBulkheadExecutorServiceRef", + processor.getExecutorService() == customBulkheadExecutorService); + + return objectBuilder.build(); + } } diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceIT.java b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationIT.java similarity index 83% rename from integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceIT.java rename to integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationIT.java index 76f553a17b7f..3abcc18d1d49 100644 --- a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceIT.java +++ b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationIT.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.faulttolerance.it; +package org.apache.camel.quarkus.component.microprofile.it.faulttolerance; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -public class CoreFaultToleranceIT extends CoreFaultToleranceTest { +class MicroProfileFaultToleranceConfigurationIT extends MicroProfileFaultToleranceConfigurationTest { } diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTest.java similarity index 77% rename from integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java rename to integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTest.java index 6aaa60aaf157..ea1a3c339812 100644 --- a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java +++ b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTest.java @@ -14,20 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.faulttolerance.it; +package org.apache.camel.quarkus.component.microprofile.it.faulttolerance; import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import io.restassured.RestAssured; import org.junit.jupiter.api.Test; -import static io.restassured.RestAssured.get; import static org.hamcrest.Matchers.is; @QuarkusTest -public class CoreFaultToleranceTest { - +@TestProfile(MicroProfileFaultToleranceConfigurationTestProfile.class) +class MicroProfileFaultToleranceConfigurationTest { @Test - public void testFaultTolerancePropertiesAreApplied() { - get("/core/fault-tolerance-configurations") + void testCustomMicroProfileFaultToleranceConfiguration() { + RestAssured.get("/microprofile-fault-tolerance/configuration") .then() .body( "isCustomCircuitBreakerRef", is(true), @@ -39,5 +40,4 @@ public void testFaultTolerancePropertiesAreApplied() { "timeoutDuration", is(3000), "timeoutPoolSize", is(3)); } - } diff --git a/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTestProfile.java b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTestProfile.java new file mode 100644 index 000000000000..70e6237dcea6 --- /dev/null +++ b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceConfigurationTestProfile.java @@ -0,0 +1,37 @@ +/* + * 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.component.microprofile.it.faulttolerance; + +import java.util.Map; + +import io.quarkus.test.junit.QuarkusTestProfile; + +public class MicroProfileFaultToleranceConfigurationTestProfile implements QuarkusTestProfile { + @Override + public Map getConfigOverrides() { + return Map.of( + "load.config.test.route", "true", + "camel.faulttolerance.circuitBreaker", "customCircuitBreaker", + "camel.faulttolerance.delay", "15", + "camel.faulttolerance.successThreshold", "4", + "camel.faulttolerance.requestVolumeThreshold", "60", + "camel.faulttolerance.failureRatio", "94", + "camel.faulttolerance.timeoutEnabled", "true", + "camel.faulttolerance.timeoutDuration", "3000", + "camel.faulttolerance.timeoutPoolSize", "3"); + } +} diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java similarity index 100% rename from integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java rename to integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java b/integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java similarity index 100% rename from integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java rename to integration-tests/microprofile-fault-tolerance/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java diff --git a/integration-test-groups/foundation/core-fault-tolerance/pom.xml b/integration-tests/microprofile-health/pom.xml similarity index 78% rename from integration-test-groups/foundation/core-fault-tolerance/pom.xml rename to integration-tests/microprofile-health/pom.xml index 2e116bcd3512..8d89c4bc34c3 100644 --- a/integration-test-groups/foundation/core-fault-tolerance/pom.xml +++ b/integration-tests/microprofile-health/pom.xml @@ -23,12 +23,12 @@ org.apache.camel.quarkus camel-quarkus-build-parent-it 3.11.0-SNAPSHOT - ../../../poms/build-parent-it/pom.xml + ../../poms/build-parent-it/pom.xml - camel-quarkus-integration-test-core-faulttolerance - Camel Quarkus :: Integration Tests :: Core Fault Tolerance :: Tests - The camel quarkus integration tests for camel.faulttolerance.* properties + camel-quarkus-integration-test-microprofile-health + Camel Quarkus :: Integration Tests :: MicroProfile Health + Integration tests for Camel Quarkus MicroProfile Health extension @@ -37,14 +37,17 @@ org.apache.camel.quarkus - camel-quarkus-microprofile-fault-tolerance + camel-quarkus-log + + + org.apache.camel.quarkus + camel-quarkus-microprofile-health io.quarkus - quarkus-resteasy-jsonb + quarkus-resteasy - io.quarkus @@ -110,7 +113,20 @@ org.apache.camel.quarkus - camel-quarkus-microprofile-fault-tolerance-deployment + camel-quarkus-log-deployment + ${project.version} + pom + test + + + * + * + + + + + org.apache.camel.quarkus + camel-quarkus-microprofile-health-deployment ${project.version} pom test diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/LivenessCheck.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/LivenessCheck.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/LivenessCheck.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/LivenessCheck.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthRouteBuilder.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthRouteBuilder.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthRouteBuilder.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthRouteBuilder.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/ReadinessCheck.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/ReadinessCheck.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/ReadinessCheck.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/ReadinessCheck.java diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/SimpleHealthCheck.java b/integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/SimpleHealthCheck.java similarity index 100% rename from integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/SimpleHealthCheck.java rename to integration-tests/microprofile-health/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/SimpleHealthCheck.java diff --git a/integration-tests/microprofile/src/main/resources/application.properties b/integration-tests/microprofile-health/src/main/resources/application.properties similarity index 100% rename from integration-tests/microprofile/src/main/resources/application.properties rename to integration-tests/microprofile-health/src/main/resources/application.properties diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java b/integration-tests/microprofile-health/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java similarity index 100% rename from integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java rename to integration-tests/microprofile-health/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroprofileHealthIT.java b/integration-tests/microprofile-health/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroprofileHealthIT.java similarity index 100% rename from integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroprofileHealthIT.java rename to integration-tests/microprofile-health/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroprofileHealthIT.java diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index e144920c8f0c..9228bfcb89c0 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -168,7 +168,8 @@ master-openshift messaging micrometer - microprofile + microprofile-fault-tolerance + microprofile-health minio mllp mongodb-grouped diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index ad2eafd63389..22f2dd8d794d 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -29,6 +29,7 @@ group-01: - jms-artemis-client - jms-ibmmq-client - jsch + - microprofile-fault-tolerance - kafka - kafka-sasl - mllp @@ -174,6 +175,7 @@ group-10: - mail - main-unknown-args-fail - main-unknown-args-ignore + - microprofile-health - platform-http-proxy - platform-http-proxy-ssl - swift @@ -205,7 +207,6 @@ group-12: - knative-endpoint-consumer - knative-event-consumer - knative-producer - - microprofile - openapi-java - paho-mqtt5 - platform-http