Skip to content

test: add unit tests for Alarm model class#51

Draft
Titanism0v0 wants to merge 1 commit into
databufflabs:masterfrom
Titanism0v0:agent/alarm-model-unit-tests
Draft

test: add unit tests for Alarm model class#51
Titanism0v0 wants to merge 1 commit into
databufflabs:masterfrom
Titanism0v0:agent/alarm-model-unit-tests

Conversation

@Titanism0v0

Copy link
Copy Markdown

Summary

  • add focused unit coverage for the Alarm status constants and record accessors
  • cover open/resolved alarms with different levels and detection ways
  • verify resolve() returns a resolved copy without mutating the original alarm
  • cover record equality, hash code, and string representation

Why

Alarm is a core alerting model and did not have direct unit coverage. These tests characterize its current public API and immutable resolution behavior, following the existing JUnit 5 and AssertJ test style.

Impact

This is a test-only change. Production behavior is unchanged.

Validation

  • mvn -pl ai-apm-web -am -Dskip.frontend=true -Dtest=AlarmTest -Dsurefire.failIfNoSpecifiedTests=false testBUILD SUCCESS, 6 tests passed
  • mvn test — attempted on Windows; ai-apm-common passed, then the reactor stopped on the existing ai-apm-ingest OtlLogLineTest.toJsonBytesTruncatesBodyByConfiguredStringLength source-encoding assertion before reaching ai-apm-web

Closes #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add unit tests for Alarm model class

1 participant