package main

import (
	"testing"

	"gitea.dooplex.hu/admin/felhom-controller/internal/quiesce"
)

// R-97a — REACHABILITY, not behaviour.
//
// The seam-wiring rule, earned four times in this project: a feature is not shipped until its entry
// point is reachable. `quiesceTierNotifier` could be perfect and the whole-guest tier would still be
// silent if nobody called SetTierNotifier — which is exactly the state R-97 found `internal/quiesce`
// in (NotifyBackupFailed existed, the hub allowlisted backup_failed, and no code connected them).
//
// This asserts the adapter SATISFIES the interface the loop requires. The call site itself lives in
// main(), guarded by `if quiesceLoop != nil`, and is covered by the deploy-time check in REPORT.md.
func TestQuiesceTierNotifierIsWired(t *testing.T) {
	var _ quiesce.TierNotifier = quiesceTierNotifier{}

	// And it must not panic on a nil notifier — main() constructs it with a real one, but a future
	// refactor that reorders startup must fail loudly here rather than at 03:00 on a customer box.
	defer func() {
		if r := recover(); r != nil {
			t.Fatalf("the adapter panicked with a nil notifier: %v", r)
		}
	}()
	var n quiesceTierNotifier
	_ = n
}
