Documentation ¶
Index ¶
Constants ¶
View Source
const ( TestClientSecret = "cHYFZMDzULZb6b7TSi+JfalaBExw85+bmRHC705jP6A=" TestClientToken = "akac-uf3nvl8qhfa26fns-scnrjt2fyqh3jnvn" TestAccessToken = "akac-h68622kxzf7ep3f3-uvegmgoluaosnmqc" TestMaxBody = 131072 )
View Source
const ( TestContractID = "ctr_C-10UBXF3" TestGroupID = "grp_52301" TestPropertyID = "prp_509694" TestProductID = "prd_HTTP_Downloads" TestRuleFormat = "v2018-09-12" )
Variables ¶
This section is empty.
Functions ¶
func HandleReqWithBody ¶
func HandleReqWithBody(t *testing.T, opts *HandleReqOpts)
HandleReqWithBody provides the HTTP endpoint to test requests with body.
func HandleReqWithoutBody ¶
func HandleReqWithoutBody(t *testing.T, opts *HandleReqOpts)
HandleReqWithoutBody provides the HTTP endpoint to test requests without body.
func NewTestEdgeGridConfig ¶
NewTestEdgeGridConfig creates fake Akamai Edge Grid config.
Types ¶
type HandleReqOpts ¶
type HandleReqOpts struct { // Mux represents HTTP Mux for a testing handler. Mux *http.ServeMux // URL represents handler's HTTP URL. URL string // RawResponse represents raw string HTTP response that needs to be returned // by the handler. RawResponse string // RawRequest represents raw string HTTP request that needs to be compared // with the actual request that will be provided by the caller. RawRequest string // QueryParams represents query params that has to be sent in URL. QueryParams map[string]string // Method contains HTTP method that needs to be compared against real method // provided by the caller. Method string // Status represents HTTP status that will be returned by the handler. Status int // CallFlag can be used to check if caller sent a request to a handler. CallFlag *bool }
HandleReqOpts represents options for the testing utils package handlers.
type TestEnv ¶
type TestEnv struct { Mux *http.ServeMux Server *httptest.Server Client *akamai.ServiceClient Config *edgegrid.Config }
TestEnv represents a testing environment for all resources.
func (*TestEnv) NewTestV1PAPIClient ¶
func (tenv *TestEnv) NewTestV1PAPIClient()
NewTestV1PAPIClient method initialize Akamai client for Property API v1.
func (*TestEnv) NewTestV3CCUClient ¶
func (tenv *TestEnv) NewTestV3CCUClient()
NewTestV3CCUClient method initialize Akamai client for CCU API v3.
func (*TestEnv) TearDownTestEnv ¶
func (tenv *TestEnv) TearDownTestEnv()
TearDownTestEnv releases the testing environment.
Click to show internal directories.
Click to hide internal directories.