INNER CODE UNIT · Go

TestDataSourceUpdateStateWithPayloadData

dikhan/terraform-provider-openapi · openapi/common_test.go:502

func TestDataSourceUpdateStateWithPayloadData(t *testing.T) {
	Convey("Given a resource factory containing a schema with property lists that have the IgnoreItemsOrder set to true", t, func() {
		objectSchemaDefinition := &SpecSchemaDefinition{
			Properties: SpecSchemaDefinitionProperties{
				newIntSchemaDefinitionPropertyWithDefaults("origin_port", "", true, false, 80),
				newStringSchemaDefinitionPropertyWithDefaults("protocol", "", true, false, "http"),
			},
		}
		arrayObjectStateValue := []interface{}{}
		listOfObjectsProperty := newListSchemaDefinitionPropertyWithDefaults("slice_object_property", "", true, false, false, arrayObjectStateValue, TypeObject, objectSchemaDefinition)
		listOfObjectsProperty.IgnoreItemsOrder = true

		listOfStrings := newListSchemaDefinitionPropertyWithDefaults("slice_property", "", true, false, false, []interface{}{"value1", "value2"}, TypeString, nil)
		listOfStrings.IgnoreItemsOrder = true

		r, resourceData := testCreateResourceFactory(t, listOfStrings, listOfObjectsProperty)
		Convey("When dataSourceUpdateStateWithPayloadData is called", func() {
			remoteData := map[string]interface{}{

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…