Part of #1: Code Coverage Below Threshold
Problem
The customMetrics handling in ResourceSnapshot has important branch logic (null check in constructor, defensive copy, unmodifiable wrapper) that is untested.
Scope
Add tests covering:
- Constructor with
null customMetrics -- getCustomMetrics() returns empty map
- Constructor with populated customMetrics map -- values preserved
- Defensive copy: modifying the original map after construction does not affect the snapshot
- Immutability:
getCustomMetrics() returns an unmodifiable map (throws on put())
Acceptance Criteria
Part of #1: Code Coverage Below Threshold
Problem
The
customMetricshandling inResourceSnapshothas important branch logic (null check in constructor, defensive copy, unmodifiable wrapper) that is untested.Scope
Add tests covering:
nullcustomMetrics --getCustomMetrics()returns empty mapgetCustomMetrics()returns an unmodifiable map (throws onput())Acceptance Criteria
customMetrics != nullternary in constructormvn clean verifypasses