testframework

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEnvironmentDefinition = func(name, regionCodeStr string, licenseId uuid.UUID, withBootstrap bool) pingone.EnvironmentCreateRequest {

		davinciTags := make([]string, 0)
		if !withBootstrap {
			davinciTags = append(davinciTags, "DAVINCI_MINIMAL")
		}

		regionCode := pingone.EnvironmentRegionCode(regionCodeStr)

		return pingone.EnvironmentCreateRequest{
			BillOfMaterials: &pingone.EnvironmentBillOfMaterials{
				Products: []pingone.EnvironmentBillOfMaterialsProduct{
					{
						Type: "PING_ONE_AUTHORIZE",
					},
					{
						Type: "PING_ONE_BASE",
					},
					{
						Type: "PING_ONE_CREDENTIALS",
					},
					{
						Type: "PING_ONE_DAVINCI",
						Tags: davinciTags,
					},
					{
						Type: "PING_ONE_MFA",
					},
					{
						Type: "PING_ONE_RISK",
					},
					{
						Type: "PING_ONE_VERIFY",
					},
				},
			},
			Description: pingone.PtrString("Test environment created by the PingOne Go SDK"),
			License: pingone.EnvironmentLicense{
				Id: licenseId,
			},
			Name:   name,
			Region: regionCode,
			Type:   "SANDBOX",
		}
	}
)

Functions

func CheckCreated

func CheckCreated(t *testing.T, responseDataObj any, expectedResponseDataType any, httpResponse *http.Response, httpError error)

func CheckDeleted

func CheckDeleted(t *testing.T, httpResponse *http.Response, httpError error)

func CheckFound

func CheckFound(t *testing.T, responseDataObj any, expectedResponseDataType any, httpResponse *http.Response, httpError error)

func CheckNotFound

func CheckNotFound(t *testing.T, responseDataObj any, httpResponse *http.Response, httpError error)

func CheckPingOneAPIErrorResponse

func CheckPingOneAPIErrorResponse(t *testing.T, httpError error, expectedErrorType any, expectedErrorMessageRegex *regexp.Regexp)

func CheckReplaced

func CheckReplaced(t *testing.T, responseDataObj any, expectedResponseDataType any, httpResponse *http.Response, httpError error)

func RandomResourceName

func RandomResourceName() string

func TestClient

func TestClient(svcConfig *config.Configuration) (*pingone.APIClient, error)

Types

type CreateConfig

type CreateConfig struct {
	// contains filtered or unexported fields
}

func CreateEnvironment

func CreateEnvironment(ctx context.Context, apiClient *pingone.APIClient) *CreateConfig

func (*CreateConfig) IfNotExists

func (e *CreateConfig) IfNotExists() *CreateConfig

IfNotExists will not return an error if the environment already exists, but instead will return the existing environment

type DeleteConfig

type DeleteConfig struct {
	// contains filtered or unexported fields
}

func DeleteEnvironment

func DeleteEnvironment(ctx context.Context, apiClient *pingone.APIClient) *DeleteConfig

func (*DeleteConfig) IfExists

func (e *DeleteConfig) IfExists() *DeleteConfig

IfExists will not return an error if the environment does not exist

type NewEnvironmentTestSuite

type NewEnvironmentTestSuite struct {
	PingOneTestSuite
	EnvironmentNamePrefix string
	EnvironmentNameSuffix string
	TestEnvironment       *TestEnvironment
	WithBootstrap         bool
}

func (*NewEnvironmentTestSuite) SetupSuite

func (s *NewEnvironmentTestSuite) SetupSuite()

func (*NewEnvironmentTestSuite) SetupTest

func (s *NewEnvironmentTestSuite) SetupTest()

Set up the test with a new environment

func (*NewEnvironmentTestSuite) TearDownSuite

func (s *NewEnvironmentTestSuite) TearDownSuite()

func (*NewEnvironmentTestSuite) TearDownTest

func (s *NewEnvironmentTestSuite) TearDownTest()

type PingOneTestSuite

type PingOneTestSuite struct {
	suite.Suite
	ApiClient *pingone.APIClient
}

func (*PingOneTestSuite) SetupSuite

func (s *PingOneTestSuite) SetupSuite()

func (*PingOneTestSuite) SetupTest

func (s *PingOneTestSuite) SetupTest()

func (*PingOneTestSuite) TearDownSuite

func (s *PingOneTestSuite) TearDownSuite()

func (*PingOneTestSuite) TearDownTest

func (s *PingOneTestSuite) TearDownTest()

type SharedEnvironmentTestSuite

type SharedEnvironmentTestSuite struct {
	PingOneTestSuite
	EnvironmentNamePrefix string
	EnvironmentNameSuffix string
	TestEnvironment       *TestEnvironment
	WithBootstrap         bool
}

func (*SharedEnvironmentTestSuite) SetupSuite

func (s *SharedEnvironmentTestSuite) SetupSuite()

Set up the entire suite with a shared environment

func (*SharedEnvironmentTestSuite) SetupTest

func (s *SharedEnvironmentTestSuite) SetupTest()

Set up the test with a new environment

func (*SharedEnvironmentTestSuite) TearDownSuite

func (s *SharedEnvironmentTestSuite) TearDownSuite()

func (*SharedEnvironmentTestSuite) TearDownTest

func (s *SharedEnvironmentTestSuite) TearDownTest()

type TestEnvironment

type TestEnvironment struct {
	EnvironmentCreateRequest pingone.EnvironmentCreateRequest
	Environment              *pingone.EnvironmentResponse
}

func NewTestEnvironment

func NewTestEnvironment(environment pingone.EnvironmentCreateRequest) *TestEnvironment

func (*TestEnvironment) Create

func (e *TestEnvironment) Create(request CreateConfig) (err error)

func (*TestEnvironment) Delete

func (e *TestEnvironment) Delete(request DeleteConfig) (err error)

Jump to

Keyboard shortcuts

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