github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/pkg/accessstrategy/fixtures_test.go (about)

     1  package accessstrategy_test
     2  
     3  import (
     4  	"net/http"
     5  )
     6  
     7  var expectedResp = &http.Response{
     8  	StatusCode: http.StatusOK,
     9  	Body:       nil,
    10  }
    11  
    12  type RoundTripFunc func(req *http.Request) (*http.Response, error)
    13  
    14  func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) {
    15  	return f(req)
    16  }
    17  
    18  func newTestClient(fn RoundTripFunc) *http.Client {
    19  	return &http.Client{
    20  		Transport: fn,
    21  	}
    22  }