gnodet commented on code in PR #25219:
URL: https://github.com/apache/camel/pull/25219#discussion_r3674331317
##########
components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeListRulesIT.java:
##########
@@ -44,38 +45,47 @@ public class EventbridgeListRulesIT extends
Aws2EventbridgeBase {
public void sendIn() throws Exception {
result.expectedMessageCount(1);
- template.send("direct:evs", new Processor() {
+ template.send("direct:evs-EventbridgeListRulesIT", new Processor() {
@Override
public void process(Exchange exchange) {
- exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME,
"firstrule");
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME,
"firstrule-EventbridgeListRulesIT");
+ }
+ });
+
+ template.send("direct:evs-EventbridgeListRulesIT", new Processor() {
+
+ @Override
+ public void process(Exchange exchange) {
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME,
"secondrule-EventbridgeListRulesIT");
}
});
- template.send("direct:evs-targets", new Processor() {
+ template.send("direct:evs-targets-EventbridgeListRulesIT", new
Processor() {
@Override
public void process(Exchange exchange) {
exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME,
"firstrule");
Review Comment:
This `RULE_NAME` was not updated with the class suffix — it should be
`"firstrule-EventbridgeListRulesIT"` to match the rule created above. As-is,
`putTargets` targets a rule that doesn't exist in this test.
```suggestion
exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME,
"firstrule-EventbridgeListRulesIT");
```
##########
components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeEnableRuleIT.java:
##########
@@ -92,28 +95,30 @@ public void process(Exchange exchange) {
ListRulesResponse resp = ex.getIn().getBody(ListRulesResponse.class);
Review Comment:
Same assertion mixing issue as `EventbridgeDisableRuleIT` — `assertEquals`
and `assertThat` in the same method. Consider converting to a single style.
##########
components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgeDisableRuleIT.java:
##########
@@ -83,9 +86,11 @@ public void process(Exchange exchange) {
ListRulesResponse resp = ex.getIn().getBody(ListRulesResponse.class);
Review Comment:
Minor: this method now mixes JUnit `assertEquals` (lines 87, 92) with
AssertJ `assertThat` (lines 88-89). Per project convention, pick one style per
method — consider converting the `assertEquals` calls to AssertJ:
```java
assertThat(resp.hasRules()).isTrue();
// ...
assertThat(disabledRule.state()).isEqualTo(RuleState.DISABLED);
```
--
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]