davsclaus commented on code in PR #26449:
URL: https://github.com/apache/camel/pull/26449#discussion_r4012512883
##########
dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/CircuitBreakerTest.groovy:
##########
@@ -60,6 +60,27 @@ class CircuitBreakerTest extends YamlTestSupport {
}
}
+ def "circuitBreaker inheritErrorHandler placeholder"() {
+ when:
+ // the schema types inheritErrorHandler as boolean so skip the strict
validation, the runtime accepts a
+ // placeholder that is resolved when the route starts (CAMEL-24696)
+ loadRoutesNoValidate '''
Review Comment:
Thanks — I tried the suggestion, and `loadRoutes` fails here:
`IllegalArgumentException: [/0/from/steps/0/circuitBreaker/inheritErrorHandler:
string found, boolean expected]`. `isRuntimeAcceptedScalar` is a filter inside
`YamlValidator` (camel-yaml-dsl-validator); `YamlTestSupport.loadRoutes` does
not go through `YamlValidator` — it runs the raw networknt
`SCHEMA.validate(target)` (`YamlTestSupport.groovy:53-62`) with no leniency, so
`loadRoutesNoValidate` is needed here. Reworded the comment to say exactly that.
Your underlying point stands though: nothing asserted that the *real*
validator accepts the placeholder. Added
`YamlValidatorSchemaGroupsTest.testInheritErrorHandlerPlaceholder` (validator
module, next to the CAMEL-24697 test) with `inheritErrorHandler:
"{{myInherit}}"` on both `circuitBreaker` and `failoverLoadBalancer`, expecting
no errors.
_Claude Code on behalf of davsclaus_
##########
dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/LoadBalanceTest.groovy:
##########
@@ -56,4 +59,30 @@ class LoadBalanceTest extends YamlTestSupport {
MockEndpoint.assertIsSatisfied(context)
}
+ def "failoverLoadBalancer inheritErrorHandler placeholder"() {
+ when:
+ // the schema types inheritErrorHandler as boolean so skip the
strict validation, the runtime accepts a
+ // placeholder that is resolved when the route starts (CAMEL-24696)
+ loadRoutesNoValidate '''
Review Comment:
Same as on `CircuitBreakerTest` — `loadRoutes` rejects it (`string found,
boolean expected`) because `YamlTestSupport` validates against the raw schema,
not through `YamlValidator`. Comment reworded; the validator-side assertion is
in the new `YamlValidatorSchemaGroupsTest.testInheritErrorHandlerPlaceholder`.
_Claude Code on behalf of davsclaus_
--
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]