35c6ff5a71
Persist reminder presentations and retry state, atomically complete collapsed deliveries, fall back across away reaches, and block permanent failures visibly (V-715, V-678). Fail closed when enabled integrations lack credentials and keep remote arms explicitly dark (V-691). Give mavweb one sanitized, request-correlated error contract (V-689). Owner explicitly requested direct commits to master.
36 lines
886 B
Go
36 lines
886 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/kami/maven/internal/delivery/ntfysink"
|
|
)
|
|
|
|
func TestWireNtfySinkRejectsMissingCredentialWhenEnabled(t *testing.T) {
|
|
_, err := wireNtfySink(&ntfysink.Config{
|
|
BaseURL: "https://ntfy.example", Topic: "maven",
|
|
})
|
|
if err == nil {
|
|
t.Fatal("expanded-empty credential did not fail an enabled reach")
|
|
}
|
|
}
|
|
|
|
func TestWireNtfySinkLeavesExplicitlyDisabledReachDark(t *testing.T) {
|
|
sink, err := wireNtfySink(&ntfysink.Config{
|
|
Disabled: true, BaseURL: "https://ntfy.example", Topic: "maven",
|
|
})
|
|
if err != nil {
|
|
t.Fatalf("wireNtfySink: %v", err)
|
|
}
|
|
if sink != nil {
|
|
t.Fatal("disabled reach built a live sink")
|
|
}
|
|
}
|
|
|
|
func TestWireNtfySinkRejectsMalformedEnabledConfig(t *testing.T) {
|
|
_, err := wireNtfySink(&ntfysink.Config{Token: "token", Topic: "maven"})
|
|
if err == nil {
|
|
t.Fatal("malformed enabled config did not fail wiring")
|
|
}
|
|
}
|