davsclaus commented on code in PR #29464:
URL: https://github.com/apache/camel/pull/29464#discussion_r4513476145
##########
components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosAdvisor.java:
##########
@@ -98,12 +100,29 @@ enum Kind {
* @param rank higher is tried first
* @param routes the routes a rule of its kind tries it in: the route, and
the other routes of a dead letter channel
* they share, which is suggested once
+ * @param with the other rules to add with the rule, for two faults at
once (CAMEL-26772); empty for one fault
*/
record Suggestion(String route, Kind kind, String recipe, String title,
String rule, String why, int rank,
- List<String> routes) {
+ List<String> routes, List<String> with) {
Suggestion(String route, Kind kind, String recipe, String title,
String rule, String why, int rank) {
- this(route, kind, recipe, title, rule, why, rank, List.of(route));
+ this(route, kind, recipe, title, rule, why, rank, List.of(route),
List.of());
+ }
+
+ Suggestion(String route, Kind kind, String recipe, String title,
String rule, String why, int rank,
+ List<String> routes) {
+ this(route, kind, recipe, title, rule, why, rank, routes,
List.of());
+ }
+
+ /** The rules to add: the rule, and the rules to add with it. */
+ List<String> rules() {
+ if (with.isEmpty()) {
+ return List.of(rule);
+ }
+ List<String> answer = new ArrayList<>();
+ answer.add(rule);
+ answer.addAll(with);
+ return answer;
Review Comment:
Done in 04b3fd21c2d6: `List.copyOf`, so both paths give an immutable list.
_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]