INNER CODE UNIT · Go

TestUpdateStateWithPayloadData

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

func TestUpdateStateWithPayloadData(t *testing.T) {
	Convey("Given a resource factory", t, func() {
		objectSchemaDefinition := &SpecSchemaDefinition{
			Properties: SpecSchemaDefinitionProperties{
				newIntSchemaDefinitionPropertyWithDefaults("origin_port", "", true, false, 80),
				newStringSchemaDefinitionPropertyWithDefaults("protocol", "", true, false, "http"),
			},
		}
		objectStateValue := map[string]interface{}{
			"origin_port": objectSchemaDefinition.Properties[0].Default,
			"protocol":    objectSchemaDefinition.Properties[1].Default,
		}
		objectProperty := newObjectSchemaDefinitionPropertyWithDefaults("object_property", "", true, false, false, objectStateValue, objectSchemaDefinition)
		arrayObjectStateValue := []interface{}{
			map[string]interface{}{
				"origin_port": 80,
				"protocol":    "http",
			},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…