cpi

package
v1.154.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCPIFunctionMockResponse

func GetCPIFunctionMockResponse(functionName, testType string) (*http.Response, error)

GetCPIFunctionMockResponse -Generate mock response payload for different CPI functions

func GetCPIFunctionNameByURLCheck

func GetCPIFunctionNameByURLCheck(url, method, testType string) string

GetCPIFunctionNameByURLCheck - get postive response by test case type

func GetEmptyHTTPResponseBodyAndErrorNil

func GetEmptyHTTPResponseBodyAndErrorNil() (*http.Response, error)

GetEmptyHTTPResponseBodyAndErrorNil -Empty http respose body

func GetFunctionNameByTestTypeAndMethod

func GetFunctionNameByTestTypeAndMethod(method, testType string) string

GetFunctionNameByTestTypeAndMethod -get function name by test tyep

func GetFunctionNamePositiveAndCreateIntegrationDesigntimeArtifactResBody

func GetFunctionNamePositiveAndCreateIntegrationDesigntimeArtifactResBody(method string) string

GetFunctionNamePositiveAndCreateIntegrationDesigntimeArtifactResBody -Get Function Name

func GetFunctionNamePositiveAndUpdateIntegrationDesigntimeArtifactResBody

func GetFunctionNamePositiveAndUpdateIntegrationDesigntimeArtifactResBody(method string) string

GetFunctionNamePositiveAndUpdateIntegrationDesigntimeArtifactResBody -Get Function Name

func GetIntegrationArtifactDeployErrorDetailsMockResponse

func GetIntegrationArtifactDeployErrorDetailsMockResponse(testType string) (*http.Response, error)

GetIntegrationArtifactDeployErrorDetailsMockResponse -Provide http respose body

func GetIntegrationArtifactDeployErrorStatusMockResponseBody

func GetIntegrationArtifactDeployErrorStatusMockResponseBody() (*http.Response, error)

GetIntegrationArtifactDeployErrorStatusMockResponseBody -Provide http respose body

func GetIntegrationArtifactDeployStatusErrorMockResponseBody

func GetIntegrationArtifactDeployStatusErrorMockResponseBody() (*http.Response, error)

GetIntegrationArtifactDeployStatusErrorMockResponseBody -Provide http respose body

func GetIntegrationArtifactDeployStatusMockResponse

func GetIntegrationArtifactDeployStatusMockResponse(testType string) (*http.Response, error)

GetIntegrationArtifactDeployStatusMockResponse -Provide http respose body

func GetIntegrationArtifactDeployStatusMockResponseBody

func GetIntegrationArtifactDeployStatusMockResponseBody() (*http.Response, error)

GetIntegrationArtifactDeployStatusMockResponseBody -Provide http respose body

func GetIntegrationArtifactDeployStatusPayload

func GetIntegrationArtifactDeployStatusPayload(status string) string

GetIntegrationArtifactDeployStatusPayload -Get Payload

func GetIntegrationArtifactGetMplStatusCommandMockResponse

func GetIntegrationArtifactGetMplStatusCommandMockResponse(testType string) (*http.Response, error)

GetIntegrationArtifactGetMplStatusCommandMockResponse -Provide http respose body

func GetIntegrationArtifactGetServiceEndpointCommandMockResponse

func GetIntegrationArtifactGetServiceEndpointCommandMockResponse(testCaseType string) (*http.Response, error)

GetIntegrationArtifactGetServiceEndpointCommandMockResponse -Provide http respose body

func GetIntegrationArtifactGetServiceEndpointPositiveCaseRespBody

func GetIntegrationArtifactGetServiceEndpointPositiveCaseRespBody() (*http.Response, error)

GetIntegrationArtifactGetServiceEndpointPositiveCaseRespBody -Provide http respose body for positive case

func GetIntegrationDesigntimeArtifactMockResponse

func GetIntegrationDesigntimeArtifactMockResponse(testType string) (*http.Response, error)

GetIntegrationDesigntimeArtifactMockResponse -Provide http respose body

func GetMockResponseByTestTypeAndMockFunctionName

func GetMockResponseByTestTypeAndMockFunctionName(mockFuntionName, testType string) (*http.Response, error)

GetMockResponseByTestTypeAndMockFunctionName - Get mock response by testtype and mock function name

func GetNegativeCaseHTTPResponseBodyAndErrorNil

func GetNegativeCaseHTTPResponseBodyAndErrorNil() (*http.Response, error)

GetNegativeCaseHTTPResponseBodyAndErrorNil -Negative case http respose body

func GetParameterKeyMissingResponseBody

func GetParameterKeyMissingResponseBody() (*http.Response, error)

GetParameterKeyMissingResponseBody -Parameter key missing http respose body

func GetPositiveCaseResponseByTestType

func GetPositiveCaseResponseByTestType(testType string) (*http.Response, error)

GetPositiveCaseResponseByTestType - get postive response by test case type

func GetRespBodyHTTPStatusCreated

func GetRespBodyHTTPStatusCreated() (*http.Response, error)

GetRespBodyHTTPStatusCreated -Provide http respose body for Http StatusOK

func GetRespBodyHTTPStatusOK

func GetRespBodyHTTPStatusOK() (*http.Response, error)

GetRespBodyHTTPStatusOK -Provide http respose body for Http StatusOK

func GetRespBodyHTTPStatusServiceErrorResponse

func GetRespBodyHTTPStatusServiceErrorResponse() (*http.Response, error)

GetRespBodyHTTPStatusServiceErrorResponse -Provide http respose body for server error

func GetRespBodyHTTPStatusServiceNotFound

func GetRespBodyHTTPStatusServiceNotFound() (*http.Response, error)

GetRespBodyHTTPStatusServiceNotFound -Provide http respose body for Http URL not Found

func IntegrationArtifactDownloadCommandMockResponse

func IntegrationArtifactDownloadCommandMockResponse(testType string) (*http.Response, error)

IntegrationArtifactDownloadCommandMockResponse -Provide http respose body

func IntegrationArtifactDownloadCommandMockResponsePositiveCaseRespBody

func IntegrationArtifactDownloadCommandMockResponsePositiveCaseRespBody() (*http.Response, error)

IntegrationArtifactDownloadCommandMockResponsePositiveCaseRespBody -Provide http respose body for positive case

func IntegrationDesigntimeArtifactUpdateMockResponse

func IntegrationDesigntimeArtifactUpdateMockResponse(testType string) (*http.Response, error)

IntegrationDesigntimeArtifactUpdateMockResponse -Provide http respose body

func NegtiveResForIntegrationArtifactGenericCommandMockResponse

func NegtiveResForIntegrationArtifactGenericCommandMockResponse(message string) (*http.Response, error)

NegtiveResForIntegrationArtifactGenericCommandMockResponse -Nagative Case http response body

func TriggerIntegrationTestMockResponse

func TriggerIntegrationTestMockResponse(testCaseType string) (*http.Response, error)

TriggerIntegrationTestMockResponse

func UpdateIntegrationDesigntimeArtifactMockResponse

func UpdateIntegrationDesigntimeArtifactMockResponse(testType string) (*http.Response, error)

UpdateIntegrationDesigntimeArtifactMockResponse -Provide http respose body

Types

type CommonUtils

type CommonUtils interface {
	GetBearerToken() (string, error)
}

CommonUtils for CPI

type HTTPUploadUtils

type HTTPUploadUtils interface {
	HandleHTTPFileUploadResponse() error
}

HTTPUploadUtils for CPI

type HttpCPIUtils

type HttpCPIUtils interface {
	HandleHTTPFileDownloadResponse() error
}

HttpCPIUtils for CPI

type HttpFileDownloadRequestParameters

type HttpFileDownloadRequestParameters struct {
	ErrMessage, FileDownloadPath string
	Response                     *http.Response
}

HttpParameters struct

func (HttpFileDownloadRequestParameters) HandleHTTPFileDownloadResponse

func (httpFileDownloadRequestParameters HttpFileDownloadRequestParameters) HandleHTTPFileDownloadResponse() error

HandleHTTPFileDownloadResponse - Handle the file download response for http multipart response

type HttpFileUploadRequestParameters

type HttpFileUploadRequestParameters struct {
	ErrMessage, FilePath, HTTPMethod, HTTPURL, SuccessMessage string
	Response                                                  *http.Response
	HTTPErr                                                   error
}

HTTPFileUploadRequestParameters struct

func (HttpFileUploadRequestParameters) HandleHTTPFileUploadResponse

func (httpFileUploadRequestParameters HttpFileUploadRequestParameters) HandleHTTPFileUploadResponse() error

HandleHTTPFileUploadResponse - Handle the file upload response

type OAuth

type OAuth struct {
	Host                  string `json:"url"`
	OAuthTokenProviderURL string `json:"tokenurl"`
	ClientID              string `json:"clientid"`
	ClientSecret          string `json:"clientsecret"`
}

OAuth is inside a CPI service key and contains more needed information

type ServiceKey

type ServiceKey struct {
	OAuth OAuth `json:"oauth"`
}

ServiceKey contains information about a CPI service key

func ReadCpiServiceKey

func ReadCpiServiceKey(serviceKeyJSON string) (cpiServiceKey ServiceKey, err error)

ReadCpiServiceKey unmarshalls the give json service key string.

type TokenParameters

type TokenParameters struct {
	TokenURL, Username, Password string
	Client                       piperhttp.Sender
}

TokenParameters struct

func (TokenParameters) GetBearerToken

func (tokenParameters TokenParameters) GetBearerToken() (string, error)

GetBearerToken -Provides the bearer token for making CPI OData calls

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL