Files
pulse/internal/alerts/config/identity_test.go
T
rcourtman a22eb2587c refactor: finish alerts manager decomposition
Delete the residual internal/alerts/alerts.go catch-all and move its remaining ownership groups into config_facade, model, constants, metric_hooks, manager, default_config, lifecycle, and escalation files.

Keep compatibility aliases in the alerts package, preserve the type-alias identity test, add a default-config pointer isolation regression test, and record the new ownership split in the alerts subsystem contract.

Proof: git diff --check -- docs/release-control/v6/internal/subsystems/alerts.md internal/alerts

Proof: go test ./internal/alerts/... -run 'TestDefaultAlertConfigUsesIndependentBackupAlertOrphanedPointer|TestTypeAliasIdentity|TestSetMetricHooks|TestSetLicenseCheckerStoresChecker|TestHistoryManager_Stop|TestEscalationDisabledWhenAlertsDisabled|TestEscalationDisabledWhenActivationPending|TestEscalationDisabledWhenActivationSnoozed|TestEscalationSkipsWhenScheduleDisabled|TestEscalationSkipsAcknowledgedAlerts|TestEscalationAdvancesLevels|TestEscalationDoesNotRepeatSameLevel|TestEscalationUsesCallback' -count=1

Proof: go test ./internal/alerts/... -count=1

Proof: go test ./internal/api -run Alert -count=1
2026-05-06 15:00:30 +01:00

26 lines
949 B
Go

package config_test
import (
"reflect"
"testing"
alerts "github.com/rcourtman/pulse-go-rewrite/internal/alerts"
alertconfig "github.com/rcourtman/pulse-go-rewrite/internal/alerts/config"
)
// TestTypeAliasIdentity verifies that alerts.AlertConfig and config.AlertConfig
// are the same underlying type via the type alias in config_facade.go.
func TestTypeAliasIdentity(t *testing.T) {
if reflect.TypeOf(alertconfig.AlertConfig{}) != reflect.TypeOf(alerts.AlertConfig{}) {
t.Error("config.AlertConfig and alerts.AlertConfig must be the same type (type alias)")
}
if reflect.TypeOf(alertconfig.ThresholdConfig{}) != reflect.TypeOf(alerts.ThresholdConfig{}) {
t.Error("config.ThresholdConfig and alerts.ThresholdConfig must be the same type")
}
if reflect.TypeOf(alertconfig.AlertLevelWarning) != reflect.TypeOf(alerts.AlertLevelWarning) {
t.Error("config.AlertLevelWarning and alerts.AlertLevelWarning must be the same type")
}
}