Documentation
¶
Overview ¶
Package mappingtest provides shared test helpers for integration mapping tests
Index ¶
- Variables
- func AssertExpressionsValid(t *testing.T, mappings []types.MappingRegistration)
- func AssertFiltered(t *testing.T, spec types.MappingOverride, envelope types.MappingEnvelope) bool
- func EvalMap(t *testing.T, spec types.MappingOverride, envelope types.MappingEnvelope) map[string]any
- func LoadExample(t *testing.T, dir, name string) json.RawMessage
- func MappingSpec(t *testing.T, mappings []types.MappingRegistration, schema string) types.MappingOverride
Constants ¶
This section is empty.
Variables ¶
View Source
var Installation = types.MappingInstallation{ ID: "int_mappingtest", Name: "Mapping Test Installation", DefinitionID: "def_mappingtest", DefinitionName: "Mapping Test", InstanceID: "tenant-mappingtest", PrimaryDirectory: true, }
Installation is the writing installation every mapping test evaluates against
Functions ¶
func AssertExpressionsValid ¶
func AssertExpressionsValid(t *testing.T, mappings []types.MappingRegistration)
AssertExpressionsValid compiles the filter and map expression of every mapping
func AssertFiltered ¶
func AssertFiltered(t *testing.T, spec types.MappingOverride, envelope types.MappingEnvelope) bool
AssertFiltered evaluates the filter expression and returns whether it matched
func EvalMap ¶
func EvalMap(t *testing.T, spec types.MappingOverride, envelope types.MappingEnvelope) map[string]any
EvalMap evaluates the map expression and returns the result as a map
func LoadExample ¶
func LoadExample(t *testing.T, dir, name string) json.RawMessage
LoadExample reads a JSON file from the given directory and returns it as a raw message
func MappingSpec ¶
func MappingSpec(t *testing.T, mappings []types.MappingRegistration, schema string) types.MappingOverride
MappingSpec returns the MappingOverride for the first mapping matching schema in the list
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.