Skip to content

Add ResourceSnapshot customMetrics edge case tests #3

Description

@sfloess

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

  • All four scenarios tested
  • Branch coverage for the customMetrics != null ternary in constructor
  • mvn clean verify passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions