Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
func StartTestProxy ¶
func StartTestProxy(tpv *TestProxyVariables) error
StartTextProxy() will initiate a record or playback session by POST-ing a request to a running instance of the test proxy. The test proxy will return a recording ID value in the response header, which we pull out and save as 'x-recording-id'.
func StopTestProxy ¶
func StopTestProxy(tpv *TestProxyVariables) error
StopTextProxy() instructs the test proxy to stop recording or stop playback, depending on the mode it is running in. The instruction to stop is made by POST-ing a request to a running instance of the test proxy. We pass in the recording ID and a directive to save the recording (when recording is running).
**Note that if you skip this step your recording WILL NOT be saved.**
Types ¶
type TestProxyTransport ¶
type TestProxyTransport struct {
// contains filtered or unexported fields
}
Derived from policy.Transporter, TestProxyTransport provides custom implementations of the abstract methods defined in the base class described above in the HTTP Transport section of this article. These custom implementations allow us to intercept and reroute app traffic sent between an app and Azure to the test proxy.
func NewTestProxyTransport ¶
func NewTestProxyTransport(transport policy.Transporter, host string, port int, recordingId string, mode string) *TestProxyTransport
type TestProxyVariables ¶
type TestProxyVariables struct { Host string Port int Mode string RecordingId string CurrentRecordingPath string // Maintain an http client for POST-ing to the test proxy to start and stop recording. // For your test client, you can either maintain the lack of certificate validation (the test-proxy // is making real HTTPS calls, so if your actual api call is having cert issues, those will still surface. HttpClient *http.Client }
TestProxyVariables class encapsulates variables that store values related to the test proxy, such as connection host (localhost), connection port (5001), and mode (record/playback).
func NewTestProxyVariables ¶
func NewTestProxyVariables(t *testing.T) *TestProxyVariables