This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 0af50864c0 Avoid comparing CDI client proxies in Fault Tolerance
configuration testing
0af50864c0 is described below
commit 0af50864c0e42d986bf9415b8aa98843083a9111
Author: James Netherton <[email protected]>
AuthorDate: Wed Mar 12 08:44:45 2025 +0000
Avoid comparing CDI client proxies in Fault Tolerance configuration testing
---
.../it/faulttolerance/MicroProfileFaultToleranceRoutes.java | 1 +
.../it/faulttolerance/MicroprofileFaultToleranceProducers.java | 5 +++--
.../it/faulttolerance/MicroprofileFaultToleranceResource.java | 5 +++--
.../MicroProfileFaultToleranceConfigurationTestProfile.java | 5 ++++-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git
a/integration-tests/microprofile-fault-tolerance/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
index d5e5ec91ad..267fa2ea24 100644
---
a/integration-tests/microprofile-fault-tolerance/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
@@ -138,6 +138,7 @@ public class MicroProfileFaultToleranceRoutes extends
RouteBuilder {
}
}
+ @ApplicationScoped
@Named("myThreadPool")
public ScheduledExecutorService myThreadPool() {
return getCamelContext().getExecutorServiceManager()
diff --git
a/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java
b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java
index f367367bf9..6939276a63 100644
---
a/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java
+++
b/integration-tests/microprofile-fault-tolerance/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceProducers.java
@@ -28,11 +28,12 @@ import
io.smallrye.faulttolerance.core.util.ExceptionDecision;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Disposes;
import jakarta.inject.Named;
+import jakarta.inject.Singleton;
@ApplicationScoped
public class MicroprofileFaultToleranceProducers {
- @ApplicationScoped
+ @Singleton
@Named("customCircuitBreaker")
CircuitBreaker<Integer> produceCustomCircuitBreaker(ThreadTimer
threadTimer) {
FaultToleranceStrategy<Integer> delegate = ctx -> null;
@@ -51,7 +52,7 @@ public class MicroprofileFaultToleranceProducers {
return Executors.newFixedThreadPool(2);
}
- @ApplicationScoped
+ @Singleton
@Named("threadTimer")
ThreadTimer threadTimer(@Named("threadTimerExecutor") ExecutorService
executorService) {
return new ThreadTimer(executorService);
diff --git
a/integration-tests/microprofile-fault-tolerance/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
index 8864a3d751..713829f886 100644
---
a/integration-tests/microprofile-fault-tolerance/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
@@ -18,6 +18,7 @@ package
org.apache.camel.quarkus.component.microprofile.it.faulttolerance;
import java.util.concurrent.ExecutorService;
+import io.quarkus.arc.ClientProxy;
import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
import jakarta.inject.Inject;
import jakarta.inject.Named;
@@ -93,7 +94,7 @@ public class MicroprofileFaultToleranceResource {
public JsonObject faultToleranceConfigurations() {
FaultToleranceProcessor processor = context.getProcessor("ftp",
FaultToleranceProcessor.class);
JsonObjectBuilder objectBuilder = Json.createObjectBuilder();
- objectBuilder.add("isCustomCircuitBreakerRef",
processor.getCircuitBreaker() == customCircuitBreaker);
+ objectBuilder.add("isCustomCircuitBreakerRef",
processor.getCircuitBreaker().equals(customCircuitBreaker));
objectBuilder.add("delay", processor.getDelay());
objectBuilder.add("successThreshold", processor.getSuccessThreshold());
objectBuilder.add("requestVolumeThreshold",
processor.getRequestVolumeThreshold());
@@ -105,7 +106,7 @@ public class MicroprofileFaultToleranceResource {
objectBuilder.add("bulkheadMaxConcurrentCalls",
processor.getBulkheadMaxConcurrentCalls());
objectBuilder.add("bulkheadWaitingTaskQueue",
processor.getBulkheadWaitingTaskQueue());
objectBuilder.add("isCustomBulkheadExecutorServiceRef",
- processor.getExecutorService() ==
customBulkheadExecutorService);
+
processor.getExecutorService().equals(ClientProxy.unwrap(customBulkheadExecutorService)));
return objectBuilder.build();
}
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
index 70e6237dce..ffb7d2827b 100644
---
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
@@ -19,13 +19,16 @@ package
org.apache.camel.quarkus.component.microprofile.it.faulttolerance;
import java.util.Map;
import io.quarkus.test.junit.QuarkusTestProfile;
+import org.apache.camel.util.CollectionHelper;
public class MicroProfileFaultToleranceConfigurationTestProfile implements
QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
- return Map.of(
+ return CollectionHelper.mapOf(
"load.config.test.route", "true",
"camel.faulttolerance.circuitBreaker", "customCircuitBreaker",
+ "camel.faulttolerance.bulkheadEnabled", "true",
+ "camel.faulttolerance.bulkheadExecutorService",
"customBulkheadExecutorService",
"camel.faulttolerance.delay", "15",
"camel.faulttolerance.successThreshold", "4",
"camel.faulttolerance.requestVolumeThreshold", "60",