(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestReplaceCertificatePaths(t *testing.T) { |
| 11 | rawConfig := `a.caddy.localhost:9443 { |
| 12 | tls /caddy.localhost.crt /caddy.localhost.key { |
| 13 | } |
| 14 | |
| 15 | redir / https://b.caddy.localhost:9443/version 301 |
| 16 | |
| 17 | respond /version 200 { |
| 18 | body "hello from a.caddy.localhost" |
| 19 | } |
| 20 | }` |
| 21 | |
| 22 | r := prependCaddyFilePath(rawConfig) |
| 23 | |
| 24 | if !strings.Contains(r, getIntegrationDir()+"/caddy.localhost.crt") { |
| 25 | t.Error("expected the /caddy.localhost.crt to be expanded to include the full path") |
| 26 | } |
| 27 | |
| 28 | if !strings.Contains(r, getIntegrationDir()+"/caddy.localhost.key") { |
| 29 | t.Error("expected the /caddy.localhost.crt to be expanded to include the full path") |
| 30 | } |
| 31 | |
| 32 | if !strings.Contains(r, "https://b.caddy.localhost:9443/version") { |
| 33 | t.Error("expected redirect uri to be unchanged") |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestLoadUnorderedJSON(t *testing.T) { |
| 38 | tester := NewTester(t) |
nothing calls this directly
no test coverage detected