Files
floci/src/test/java
Yoshiyuki Ohta ff80dac780 fix(eventbridge): keep persisted rules from disappearing on reload (#878)
Rule.getRegion() is a derived getter (computed from the rule's ARN) but
has no matching setter. When EventBridgeService runs in any non-memory
storage mode, PersistentStorage's ObjectMapper writes "region" into
eventbridge-rules.json on save, then throws UnrecognizedPropertyException
on the next startup because Rule cannot deserialize it. The exception is
swallowed by PersistentStorage.load(), so the rule store comes up empty
and every PutRule made before the restart silently disappears.

Two changes on Rule:

- @JsonIgnore on getRegion() so the derived field is no longer written
  to disk.
- @JsonIgnoreProperties(ignoreUnknown = true) on the class to match the
  convention used by Target, InputTransformer, SqsParameters and most
  other persisted models, and to let a file that includes "region"
  (written before this change) still load cleanly after upgrade.

Adds RulePersistenceTest covering the PersistentStorage round-trip and
unknown-property tolerance.
2026-05-17 11:24:30 -05:00
..