From 1ad9e50197005e4b848a20622d63ae5a15e6bb6e Mon Sep 17 00:00:00 2001 From: Brenna Hewer-Darroch <21015366+bcmdarroch@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:40:34 -0500 Subject: [PATCH] remove unnecessary httpclient test --- httpclient/httpclient_test.go | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/httpclient/httpclient_test.go b/httpclient/httpclient_test.go index 5ee233e3..b2eaa53e 100644 --- a/httpclient/httpclient_test.go +++ b/httpclient/httpclient_test.go @@ -105,39 +105,6 @@ func TestNew(t *testing.T) { require.Equal(t, uint32(2), atomic.LoadUint32(&numRequests)) }) - t.Run("legacy configuration, no source channel", func(t *testing.T) { - numRequests = 0 - - cfg := Config{ - HostPath: ts.URL, - AuthURL: ts.URL, - ClientID: clientID, - ClientSecret: clientSecret, - // Override the base http.Client so that we trust the test server's TLS - Client: ts.Client(), - } - - // The test's important assertions occur in the test server handler above. - // When an http client is initialized, it tries to obtain an access token using the configured token URL (from an auth provider), client ID, and client secret. - // The token request embedded in this client initializer hits the mock auth provider handler above ('/oauth/token'). - cl, err := New(cfg) - require.NoError(t, err) - - consulClient := consul.New(cl, nil) - listParams := consul.NewListParams() - listParams.LocationOrganizationID = orgID - listParams.LocationProjectID = projID - - // This SDK request hits the mock Consul List API handler above ('/consul/2021-02-04/organizations...'). - // The handler verifies that the expected bearer token is provided. - _, err = consulClient.List(listParams, nil) - require.NoError(t, err) - - // Make sure we actually handled both the auth and the GET request and didn't - // just skip all the assertions! - require.Equal(t, uint32(2), atomic.LoadUint32(&numRequests)) - }) - t.Run("HCPConfig", func(t *testing.T) { numRequests = 0