Skip to content

Commit

Permalink
Tidy test argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmcconnell committed Sep 25, 2024
1 parent 2e8e753 commit 12d9915
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/server/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/")

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 12d9915

Please sign in to comment.