Bootstrap copied BFF and local accounts with public Sendico contracts (#34)

This commit is contained in:
Stephan D committed 2026-09-12 13:37:48 +02:00
1 parent 67dc5b5b1e
commit 7062672a87
556 files changed
+42291 -777

No files matched your search

@@ -0,0 +1,26 @@
package merrors
import (
"errors"
"testing"
)
func TestPaymentExecutionNotAcceptedPreservesClassificationAndCause(t *testing.T) {
cause := ServiceUnavailable("orchestrator unavailable")
err := PaymentExecutionNotAcceptedWrap(cause, "execution was rejected")
if !errors.Is(err, ErrFailedPrecondition) ||
!errors.Is(err, ErrPaymentExecutionNotAccepted) ||
!errors.Is(err, cause) {
t.Fatalf("PaymentExecutionNotAcceptedWrap() classification = %v", err)
}
reason, ok := Reason(err)
if !ok || reason != ReasonPaymentExecutionNotAccepted {
t.Fatalf("PaymentExecutionNotAcceptedWrap() reason = %q, %t", reason, ok)
}
restored, ok := FromReason(reason, err.Error())
if !ok || !errors.Is(restored, ErrPaymentExecutionNotAccepted) ||
!errors.Is(restored, ErrFailedPrecondition) {
t.Fatalf("FromReason() = %v, %t", restored, ok)
}
}