(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestLoad_FallbackTargetNotFound(t *testing.T) { |
| 110 | cfgPath := writeTempConfig(t, ` |
| 111 | backends: |
| 112 | - name: b1 |
| 113 | type: mock |
| 114 | timeout_ms: 100 |
| 115 | cost: { unit: 1, currency: credit } |
| 116 | tenants: |
| 117 | - id: t1 |
| 118 | routing: |
| 119 | default_backend: b1 |
| 120 | reliability: |
| 121 | fallback_enabled: true |
| 122 | fallback_rules: |
| 123 | - from_backend: b1 |
| 124 | on: [timeout] |
| 125 | fallback_to: missing |
| 126 | `) |
| 127 | |
| 128 | _, err := Load(cfgPath) |
| 129 | if err == nil || !strings.Contains(err.Error(), "fallback_to backend") { |
| 130 | t.Fatalf("expected fallback target validation error, got: %v", err) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func TestLoad_DuplicateRoutingRuleName(t *testing.T) { |
| 135 | cfgPath := writeTempConfig(t, ` |
nothing calls this directly
no test coverage detected