Documentation ¶
Index ¶
- func AssertNoRatelimitAnnotations(t *testing.T, actualAnnotations annotations.Annotations)
- func AssertValidation(t *testing.T, validate func() error, expectedSuccess bool)
- func AssertWasRatelimited(t *testing.T, actualAnnotations annotations.Annotations)
- func ExerciseTestCase(t *testing.T, configurationSchema field.Configuration, ...)
- func ExerciseTestCases(t *testing.T, configurationSchema field.Configuration, ...)
- func ExerciseTestCasesFromExpressions(t *testing.T, configurationSchema field.Configuration, ...)
- func ExhaustEntitlementPagination(ctx context.Context, c connectorbuilder.ResourceSyncer, resource *v2.Resource) ([]*v2.Entitlement, annotations.Annotations, error)
- func ExhaustGrantPagination(ctx context.Context, c connectorbuilder.ResourceSyncer, resource *v2.Resource) ([]*v2.Grant, annotations.Annotations, error)
- func ExhaustResourcePagination(ctx context.Context, c connectorbuilder.ResourceSyncer) ([]*v2.Resource, annotations.Annotations, error)
- func GrantsIntegrationTest(ctx context.Context, t *testing.T, c builder, principal *v2.Resource, ...)
- func IsRatelimited(actualAnnotations annotations.Annotations) bool
- func MakeViper(input map[string]string) *viper.Viper
- type TestCase
- type TestCaseFromExpression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoRatelimitAnnotations ¶
func AssertNoRatelimitAnnotations( t *testing.T, actualAnnotations annotations.Annotations, )
AssertNoRatelimitAnnotations - the annotations that ResourceSyncers return can contain "informational" ratelimit annotations that let the caller know how much quota they have left and that their request was _not_ rejected. This helper just asserts that there are no "your request was ratelimited" annotations.
func AssertValidation ¶ added in v0.2.22
AssertValidation - call an arbitrary validation function and assert the result matches the expected result.
func AssertWasRatelimited ¶
func AssertWasRatelimited( t *testing.T, actualAnnotations annotations.Annotations, )
func ExerciseTestCase ¶ added in v0.2.23
func ExerciseTestCases ¶ added in v0.2.22
func ExerciseTestCases( t *testing.T, configurationSchema field.Configuration, extraValidationFunction func(*viper.Viper) error, testCases []TestCase, )
ExerciseTestCases - this helper function is meant to be called by each connector to make sure that the every `Field` and `Relationship` do what we expect. Some connectors need to run custom validations, and they can be added as the `extraValidationFunction` parameter.
func ExerciseTestCasesFromExpressions ¶ added in v0.2.22
func ExerciseTestCasesFromExpressions( t *testing.T, configurationSchema field.Configuration, extraValidationFunction func(*viper.Viper) error, expressionParser func(string) (map[string]string, error), testCases []TestCaseFromExpression, )
ExerciseTestCasesFromExpressions - Like ExerciseTestCases, but instead of passing a `map[string]string` to each test case, pass a function that parses configs from strings and pass each test case an expression as a string.
func ExhaustEntitlementPagination ¶
func ExhaustEntitlementPagination( ctx context.Context, c connectorbuilder.ResourceSyncer, resource *v2.Resource, ) ( []*v2.Entitlement, annotations.Annotations, error, )
func ExhaustGrantPagination ¶
func ExhaustGrantPagination( ctx context.Context, c connectorbuilder.ResourceSyncer, resource *v2.Resource, ) ( []*v2.Grant, annotations.Annotations, error, )
func ExhaustResourcePagination ¶
func ExhaustResourcePagination( ctx context.Context, c connectorbuilder.ResourceSyncer, ) ( []*v2.Resource, annotations.Annotations, error, )
func GrantsIntegrationTest ¶
func GrantsIntegrationTest( ctx context.Context, t *testing.T, c builder, principal *v2.Resource, entitlement *v2.Entitlement, )
GrantsIntegrationTest - create a grant and then revoke it. Any connector that implements provisioning should be able to successfully run this test.
func IsRatelimited ¶
func IsRatelimited(actualAnnotations annotations.Annotations) bool