diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-08-28 07:31:11 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-08-28 07:31:11 +0300 |
commit | 9474a11af3f797d1fc6da71f929669faa9426b1d (patch) | |
tree | cc11b5187975d3ea20e80b4e6218700db7564feb /helpers_test.go | |
parent | 8680dd6889cf601888a7a740e98913ba13e7c102 (diff) |
Add domain-config-source acceptance tests
Diffstat (limited to 'helpers_test.go')
-rw-r--r-- | helpers_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/helpers_test.go b/helpers_test.go index a55399f4..16032c38 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -420,13 +420,15 @@ func waitForRoundtrips(t *testing.T, listeners []ListenSpec, timeout time.Durati require.Equal(t, len(listeners), nListening, "all listeners must be accepting TCP connections") } -func NewGitlabDomainsSourceStub(t *testing.T) *httptest.Server { +func NewGitlabDomainsSourceStub(t *testing.T) (*httptest.Server, *bool) { + called := false mux := http.NewServeMux() mux.HandleFunc("/api/v4/internal/pages/status", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNoContent) }) handler := func(w http.ResponseWriter, r *http.Request) { + called = true domain := r.URL.Query().Get("host") path := "shared/lookups/" + domain + ".json" @@ -448,7 +450,7 @@ func NewGitlabDomainsSourceStub(t *testing.T) *httptest.Server { } mux.HandleFunc("/api/v4/internal/pages", handler) - return httptest.NewServer(mux) + return httptest.NewServer(mux), &called } func newConfigFile(configs ...string) (string, error) { |