Skip to content

Commit

Permalink
remove httpClient interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed Feb 27, 2024
1 parent 19c1d6a commit 9e50d00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions internal/btp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

type LocalClient struct {
credentials *CISCredentials
cis httpClientInterface
cis *httpClient
}

func NewLocalClient(credentials *CISCredentials, token *XSUAAToken) *LocalClient {
Expand All @@ -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"`
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion internal/btp/provision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9e50d00

Please sign in to comment.