From 9e50d0074370551dfcf1a0eca285a9084b761137 Mon Sep 17 00:00:00 2001 From: Filip Strozik Date: Tue, 27 Feb 2024 14:14:10 +0100 Subject: [PATCH] remove httpClient interface --- internal/btp/client.go | 11 ++--------- internal/btp/provision_test.go | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/internal/btp/client.go b/internal/btp/client.go index 90ddd754a..8e4b460ac 100644 --- a/internal/btp/client.go +++ b/internal/btp/client.go @@ -12,7 +12,7 @@ import ( type LocalClient struct { credentials *CISCredentials - cis httpClientInterface + cis *httpClient } func NewLocalClient(credentials *CISCredentials, token *XSUAAToken) *LocalClient { @@ -32,13 +32,6 @@ func (t *oauthTransport) RoundTrip(r *http.Request) (*http.Response, error) { return http.DefaultTransport.RoundTrip(r) } -type httpClientInterface interface { - Get(string, requestOptions) (*http.Response, error) - Put(string, requestOptions) (*http.Response, error) - Post(string, requestOptions) (*http.Response, error) - Patch(string, requestOptions) (*http.Response, error) -} - type cisError struct { Code int `json:"code"` Message string `json:"message"` @@ -60,7 +53,7 @@ type httpClient struct { client *http.Client } -func newHttpClient(token *XSUAAToken) httpClientInterface { +func newHttpClient(token *XSUAAToken) *httpClient { return &httpClient{ client: &http.Client{ Transport: &oauthTransport{ diff --git a/internal/btp/provision_test.go b/internal/btp/provision_test.go index d30089084..c32d22f73 100644 --- a/internal/btp/provision_test.go +++ b/internal/btp/provision_test.go @@ -35,7 +35,7 @@ func fixProvisionHandler(t *testing.T) func(http.ResponseWriter, *http.Request) } func fixProvisionErrorHandler(t *testing.T) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, _ *http.Request) { data := cisErrorResponse{ Error: cisError{ Message: "error",