From 12d99151b88cead89e1a2e9f200bdc45b92c0bd9 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Wed, 25 Sep 2024 17:10:17 -0400 Subject: [PATCH] Tidy test argument --- internal/server/router_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/server/router_test.go b/internal/server/router_test.go index b8e0066..980b40e 100644 --- a/internal/server/router_test.go +++ b/internal/server/router_test.go @@ -112,7 +112,7 @@ func TestRouter_ActiveServiceWithoutHost(t *testing.T) { router := testRouter(t) _, target := testBackend(t, "first", http.StatusOK) - require.NoError(t, router.SetServiceTarget("service1", []string{""}, target, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) + require.NoError(t, router.SetServiceTarget("service1", defaultEmptyHosts, target, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) statusCode, body := sendGETRequest(router, "http://dummy.example.com/") @@ -268,7 +268,7 @@ func TestRouter_TargetWithoutHostActsAsWildcard(t *testing.T) { _, second := testBackend(t, "second", http.StatusOK) require.NoError(t, router.SetServiceTarget("service1", []string{"s1.example.com"}, first, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) - require.NoError(t, router.SetServiceTarget("default", []string{""}, second, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) + require.NoError(t, router.SetServiceTarget("default", defaultEmptyHosts, second, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) statusCode, body := sendGETRequest(router, "http://s1.example.com/") assert.Equal(t, http.StatusOK, statusCode) @@ -300,7 +300,7 @@ func TestRouter_EnablingRollout(t *testing.T) { _, first := testBackend(t, "first", http.StatusOK) _, second := testBackend(t, "second", http.StatusOK) - require.NoError(t, router.SetServiceTarget("service1", []string{""}, first, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) + require.NoError(t, router.SetServiceTarget("service1", defaultEmptyHosts, first, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) require.NoError(t, router.SetRolloutTarget("service1", second, DefaultDeployTimeout, DefaultDrainTimeout)) checkResponse := func(expected string) { @@ -330,7 +330,7 @@ func TestRouter_RestoreLastSavedState(t *testing.T) { _, second := testBackend(t, "second", http.StatusOK) router := NewRouter(statePath) - require.NoError(t, router.SetServiceTarget("default", []string{""}, first, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) + require.NoError(t, router.SetServiceTarget("default", defaultEmptyHosts, first, defaultServiceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) require.NoError(t, router.SetServiceTarget("other", []string{"other.example.com"}, second, ServiceOptions{TLSEnabled: true}, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout)) statusCode, body := sendGETRequest(router, "http://something.example.com")