diff --git a/CHANGELOG.md b/CHANGELOG.md index b8b3e52195..16606d83d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Logs +## v1.0.14 +* Refreshes the terraform module to be in sync with the latest Cisco Intersight model (build 4430) + ## v1.0.13 Release Date: 6th August 2021 * Refreshes the terraform module to be in sync with the latest Cisco Intersight model (build 4403) diff --git a/intersight/flatten_functions_test.go b/intersight/flatten_functions_test.go index 8c52c72031..f120637da0 100644 --- a/intersight/flatten_functions_test.go +++ b/intersight/flatten_functions_test.go @@ -56,7 +56,7 @@ func CheckError(t *testing.T, e error) { func TestFlattenListAdapterAdapterConfig(t *testing.T) { p := []models.AdapterAdapterConfig{} var d = &schema.ResourceData{} - c := `{"SlotId":"SlotId %d","ClassId":"adapter.AdapterConfig","ObjectType":"adapter.AdapterConfig"}` + c := `{"ClassId":"adapter.AdapterConfig","SlotId":"SlotId %d","ObjectType":"adapter.AdapterConfig"}` //test when the response is empty ffOpEmpty := flattenListAdapterAdapterConfig(p, d) @@ -71,7 +71,7 @@ func TestFlattenListAdapterAdapterConfig(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterAdapterConfig(p, d) - expectedOp := []map[string]interface{}{{"slot_id": "SlotId 1", "class_id": "adapter.AdapterConfig", "object_type": "adapter.AdapterConfig"}, {"slot_id": "SlotId 2", "class_id": "adapter.AdapterConfig", "object_type": "adapter.AdapterConfig"}} + expectedOp := []map[string]interface{}{{"class_id": "adapter.AdapterConfig", "slot_id": "SlotId 1", "object_type": "adapter.AdapterConfig"}, {"class_id": "adapter.AdapterConfig", "slot_id": "SlotId 2", "object_type": "adapter.AdapterConfig"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -104,7 +104,7 @@ func TestFlattenListAdapterExtEthInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { p := []models.AdapterHostEthInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostEthInterfaceRelationship(p, d) @@ -119,7 +119,7 @@ func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostEthInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -128,7 +128,7 @@ func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { p := []models.AdapterHostFcInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostFcInterfaceRelationship(p, d) @@ -143,7 +143,7 @@ func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostFcInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -152,7 +152,7 @@ func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { p := []models.AdapterHostIscsiInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostIscsiInterfaceRelationship(p, d) @@ -167,7 +167,7 @@ func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostIscsiInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -176,7 +176,7 @@ func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterUnitRelationship(t *testing.T) { p := []models.AdapterUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAdapterUnitRelationship(p, d) @@ -191,7 +191,7 @@ func TestFlattenListAdapterUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -200,7 +200,7 @@ func TestFlattenListAdapterUnitRelationship(t *testing.T) { func TestFlattenListApplianceApiStatus(t *testing.T) { p := []models.ApplianceApiStatus{} var d = &schema.ResourceData{} - c := `{"Reason":"Reason %d","Response":32,"ClassId":"appliance.ApiStatus","ObjectType":"appliance.ApiStatus","ElapsedTime":32.000000,"ObjectName":"ObjectName %d"}` + c := `{"ClassId":"appliance.ApiStatus","ElapsedTime":32.000000,"ObjectName":"ObjectName %d","Reason":"Reason %d","Response":32,"ObjectType":"appliance.ApiStatus"}` //test when the response is empty ffOpEmpty := flattenListApplianceApiStatus(p, d) @@ -215,7 +215,7 @@ func TestFlattenListApplianceApiStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceApiStatus(p, d) - expectedOp := []map[string]interface{}{{"reason": "Reason 1", "response": 32, "class_id": "appliance.ApiStatus", "object_type": "appliance.ApiStatus", "elapsed_time": 32.000000, "object_name": "ObjectName 1"}, {"reason": "Reason 2", "response": 32, "class_id": "appliance.ApiStatus", "object_type": "appliance.ApiStatus", "elapsed_time": 32.000000, "object_name": "ObjectName 2"}} + expectedOp := []map[string]interface{}{{"class_id": "appliance.ApiStatus", "elapsed_time": 32.000000, "object_name": "ObjectName 1", "reason": "Reason 1", "response": 32, "object_type": "appliance.ApiStatus"}, {"class_id": "appliance.ApiStatus", "elapsed_time": 32.000000, "object_name": "ObjectName 2", "reason": "Reason 2", "response": 32, "object_type": "appliance.ApiStatus"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -248,7 +248,7 @@ func TestFlattenListApplianceAppStatusRelationship(t *testing.T) { func TestFlattenListApplianceCertRenewalPhase(t *testing.T) { p := []models.ApplianceCertRenewalPhase{} var d = &schema.ResourceData{} - c := `{"Message":"Message %d","Name":"Name %d","ClassId":"appliance.CertRenewalPhase","ObjectType":"appliance.CertRenewalPhase","Failed":true}` + c := `{"Name":"Name %d","Failed":true,"Message":"Message %d","ClassId":"appliance.CertRenewalPhase","ObjectType":"appliance.CertRenewalPhase"}` //test when the response is empty ffOpEmpty := flattenListApplianceCertRenewalPhase(p, d) @@ -263,7 +263,7 @@ func TestFlattenListApplianceCertRenewalPhase(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceCertRenewalPhase(p, d) - expectedOp := []map[string]interface{}{{"message": "Message 1", "name": "Name 1", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase", "failed": true}, {"message": "Message 2", "name": "Name 2", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase", "failed": true}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "failed": true, "message": "Message 1", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase"}, {"name": "Name 2", "failed": true, "message": "Message 2", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -296,7 +296,7 @@ func TestFlattenListApplianceDataExportPolicyRelationship(t *testing.T) { func TestFlattenListApplianceFileSystemStatusRelationship(t *testing.T) { p := []models.ApplianceFileSystemStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListApplianceFileSystemStatusRelationship(p, d) @@ -311,7 +311,7 @@ func TestFlattenListApplianceFileSystemStatusRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceFileSystemStatusRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -320,7 +320,7 @@ func TestFlattenListApplianceFileSystemStatusRelationship(t *testing.T) { func TestFlattenListApplianceGroupStatusRelationship(t *testing.T) { p := []models.ApplianceGroupStatusRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListApplianceGroupStatusRelationship(p, d) @@ -335,7 +335,7 @@ func TestFlattenListApplianceGroupStatusRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceGroupStatusRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -344,7 +344,7 @@ func TestFlattenListApplianceGroupStatusRelationship(t *testing.T) { func TestFlattenListApplianceKeyValuePair(t *testing.T) { p := []models.ApplianceKeyValuePair{} var d = &schema.ResourceData{} - c := `{"ObjectType":"appliance.KeyValuePair","Key":"Key %d","Value":"Value %d","ClassId":"appliance.KeyValuePair"}` + c := `{"ObjectType":"appliance.KeyValuePair","ClassId":"appliance.KeyValuePair","Key":"Key %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListApplianceKeyValuePair(p, d) @@ -359,7 +359,7 @@ func TestFlattenListApplianceKeyValuePair(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceKeyValuePair(p, d) - expectedOp := []map[string]interface{}{{"object_type": "appliance.KeyValuePair", "key": "Key 1", "value": "Value 1", "class_id": "appliance.KeyValuePair"}, {"object_type": "appliance.KeyValuePair", "key": "Key 2", "value": "Value 2", "class_id": "appliance.KeyValuePair"}} + expectedOp := []map[string]interface{}{{"object_type": "appliance.KeyValuePair", "class_id": "appliance.KeyValuePair", "key": "Key 1", "value": "Value 1"}, {"object_type": "appliance.KeyValuePair", "class_id": "appliance.KeyValuePair", "key": "Key 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -368,7 +368,7 @@ func TestFlattenListApplianceKeyValuePair(t *testing.T) { func TestFlattenListApplianceStatusCheck(t *testing.T) { p := []models.ApplianceStatusCheck{} var d = &schema.ResourceData{} - c := `{"ObjectType":"appliance.StatusCheck","Code":"Code %d","Result":"Result %d","ClassId":"appliance.StatusCheck"}` + c := `{"ClassId":"appliance.StatusCheck","ObjectType":"appliance.StatusCheck","Code":"Code %d","Result":"Result %d"}` //test when the response is empty ffOpEmpty := flattenListApplianceStatusCheck(p, d) @@ -383,7 +383,7 @@ func TestFlattenListApplianceStatusCheck(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceStatusCheck(p, d) - expectedOp := []map[string]interface{}{{"object_type": "appliance.StatusCheck", "code": "Code 1", "result": "Result 1", "class_id": "appliance.StatusCheck"}, {"object_type": "appliance.StatusCheck", "code": "Code 2", "result": "Result 2", "class_id": "appliance.StatusCheck"}} + expectedOp := []map[string]interface{}{{"class_id": "appliance.StatusCheck", "object_type": "appliance.StatusCheck", "code": "Code 1", "result": "Result 1"}, {"class_id": "appliance.StatusCheck", "object_type": "appliance.StatusCheck", "code": "Code 2", "result": "Result 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -392,7 +392,7 @@ func TestFlattenListApplianceStatusCheck(t *testing.T) { func TestFlattenListAssetClusterMemberRelationship(t *testing.T) { p := []models.AssetClusterMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAssetClusterMemberRelationship(p, d) @@ -407,7 +407,7 @@ func TestFlattenListAssetClusterMemberRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetClusterMemberRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -416,7 +416,7 @@ func TestFlattenListAssetClusterMemberRelationship(t *testing.T) { func TestFlattenListAssetConnection(t *testing.T) { p := []models.AssetConnection{} var d = &schema.ResourceData{} - c := `{"ClassId":"asset.Connection","ObjectType":"asset.Connection"}` + c := `{"ObjectType":"asset.Connection","ClassId":"asset.Connection"}` //test when the response is empty ffOpEmpty := flattenListAssetConnection(p, d) @@ -431,7 +431,7 @@ func TestFlattenListAssetConnection(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetConnection(p, d) - expectedOp := []map[string]interface{}{{"class_id": "asset.Connection", "object_type": "asset.Connection"}, {"class_id": "asset.Connection", "object_type": "asset.Connection"}} + expectedOp := []map[string]interface{}{{"object_type": "asset.Connection", "class_id": "asset.Connection"}, {"object_type": "asset.Connection", "class_id": "asset.Connection"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -440,7 +440,7 @@ func TestFlattenListAssetConnection(t *testing.T) { func TestFlattenListAssetDeploymentRelationship(t *testing.T) { p := []models.AssetDeploymentRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAssetDeploymentRelationship(p, d) @@ -455,7 +455,7 @@ func TestFlattenListAssetDeploymentRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetDeploymentRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -488,7 +488,7 @@ func TestFlattenListAssetDeploymentDeviceRelationship(t *testing.T) { func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { p := []models.AssetDeviceRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListAssetDeviceRegistrationRelationship(p, d) @@ -503,7 +503,7 @@ func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetDeviceRegistrationRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -512,7 +512,7 @@ func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { func TestFlattenListAssetMeteringType(t *testing.T) { p := []models.AssetMeteringType{} var d = &schema.ResourceData{} - c := `{"ObjectType":"asset.MeteringType","Name":"Name %d","Unit":"Unit %d","ClassId":"asset.MeteringType"}` + c := `{"ClassId":"asset.MeteringType","ObjectType":"asset.MeteringType","Name":"Name %d","Unit":"Unit %d"}` //test when the response is empty ffOpEmpty := flattenListAssetMeteringType(p, d) @@ -527,7 +527,7 @@ func TestFlattenListAssetMeteringType(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetMeteringType(p, d) - expectedOp := []map[string]interface{}{{"object_type": "asset.MeteringType", "name": "Name 1", "unit": "Unit 1", "class_id": "asset.MeteringType"}, {"object_type": "asset.MeteringType", "name": "Name 2", "unit": "Unit 2", "class_id": "asset.MeteringType"}} + expectedOp := []map[string]interface{}{{"class_id": "asset.MeteringType", "object_type": "asset.MeteringType", "name": "Name 1", "unit": "Unit 1"}, {"class_id": "asset.MeteringType", "object_type": "asset.MeteringType", "name": "Name 2", "unit": "Unit 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -560,7 +560,7 @@ func TestFlattenListAssetService(t *testing.T) { func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { p := []models.BiosBootDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListBiosBootDeviceRelationship(p, d) @@ -575,7 +575,7 @@ func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBiosBootDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -584,7 +584,7 @@ func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { func TestFlattenListBiosUnitRelationship(t *testing.T) { p := []models.BiosUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListBiosUnitRelationship(p, d) @@ -599,7 +599,7 @@ func TestFlattenListBiosUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBiosUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -608,7 +608,7 @@ func TestFlattenListBiosUnitRelationship(t *testing.T) { func TestFlattenListBootCddDeviceRelationship(t *testing.T) { p := []models.BootCddDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootCddDeviceRelationship(p, d) @@ -623,7 +623,7 @@ func TestFlattenListBootCddDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootCddDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -632,7 +632,7 @@ func TestFlattenListBootCddDeviceRelationship(t *testing.T) { func TestFlattenListBootDeviceBase(t *testing.T) { p := []models.BootDeviceBase{} var d = &schema.ResourceData{} - c := `{"Enabled":true,"Name":"Name %d","ClassId":"boot.DeviceBase","ObjectType":"boot.DeviceBase"}` + c := `{"ObjectType":"boot.DeviceBase","ClassId":"boot.DeviceBase","Enabled":true,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListBootDeviceBase(p, d) @@ -647,7 +647,7 @@ func TestFlattenListBootDeviceBase(t *testing.T) { p = append(p, x) } ffOp := flattenListBootDeviceBase(p, d) - expectedOp := []map[string]interface{}{{"enabled": true, "name": "Name 1", "class_id": "boot.DeviceBase", "object_type": "boot.DeviceBase"}, {"enabled": true, "name": "Name 2", "class_id": "boot.DeviceBase", "object_type": "boot.DeviceBase"}} + expectedOp := []map[string]interface{}{{"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "enabled": true, "name": "Name 1"}, {"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "enabled": true, "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -656,7 +656,7 @@ func TestFlattenListBootDeviceBase(t *testing.T) { func TestFlattenListBootHddDeviceRelationship(t *testing.T) { p := []models.BootHddDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootHddDeviceRelationship(p, d) @@ -671,7 +671,7 @@ func TestFlattenListBootHddDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootHddDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -680,7 +680,7 @@ func TestFlattenListBootHddDeviceRelationship(t *testing.T) { func TestFlattenListBootIscsiDeviceRelationship(t *testing.T) { p := []models.BootIscsiDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootIscsiDeviceRelationship(p, d) @@ -695,7 +695,7 @@ func TestFlattenListBootIscsiDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootIscsiDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -704,7 +704,7 @@ func TestFlattenListBootIscsiDeviceRelationship(t *testing.T) { func TestFlattenListBootNvmeDeviceRelationship(t *testing.T) { p := []models.BootNvmeDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListBootNvmeDeviceRelationship(p, d) @@ -719,7 +719,7 @@ func TestFlattenListBootNvmeDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootNvmeDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -728,7 +728,7 @@ func TestFlattenListBootNvmeDeviceRelationship(t *testing.T) { func TestFlattenListBootPchStorageDeviceRelationship(t *testing.T) { p := []models.BootPchStorageDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootPchStorageDeviceRelationship(p, d) @@ -743,7 +743,7 @@ func TestFlattenListBootPchStorageDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootPchStorageDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -752,7 +752,7 @@ func TestFlattenListBootPchStorageDeviceRelationship(t *testing.T) { func TestFlattenListBootPxeDeviceRelationship(t *testing.T) { p := []models.BootPxeDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListBootPxeDeviceRelationship(p, d) @@ -767,7 +767,7 @@ func TestFlattenListBootPxeDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootPxeDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -776,7 +776,7 @@ func TestFlattenListBootPxeDeviceRelationship(t *testing.T) { func TestFlattenListBootSanDeviceRelationship(t *testing.T) { p := []models.BootSanDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootSanDeviceRelationship(p, d) @@ -791,7 +791,7 @@ func TestFlattenListBootSanDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootSanDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -800,7 +800,7 @@ func TestFlattenListBootSanDeviceRelationship(t *testing.T) { func TestFlattenListBootSdDeviceRelationship(t *testing.T) { p := []models.BootSdDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootSdDeviceRelationship(p, d) @@ -815,7 +815,7 @@ func TestFlattenListBootSdDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootSdDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -824,7 +824,7 @@ func TestFlattenListBootSdDeviceRelationship(t *testing.T) { func TestFlattenListBootUefiShellDeviceRelationship(t *testing.T) { p := []models.BootUefiShellDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootUefiShellDeviceRelationship(p, d) @@ -839,7 +839,7 @@ func TestFlattenListBootUefiShellDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootUefiShellDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -872,7 +872,7 @@ func TestFlattenListBootUsbDeviceRelationship(t *testing.T) { func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { p := []models.BootVmediaDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootVmediaDeviceRelationship(p, d) @@ -887,7 +887,7 @@ func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootVmediaDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -896,7 +896,7 @@ func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { p := []models.CapabilityCapabilityRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListCapabilityCapabilityRelationship(p, d) @@ -911,7 +911,7 @@ func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilityCapabilityRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -920,7 +920,7 @@ func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { func TestFlattenListCapabilityPortRange(t *testing.T) { p := []models.CapabilityPortRange{} var d = &schema.ResourceData{} - c := `{"StartSlotId":32,"EndPortId":32,"ClassId":"capability.PortRange","ObjectType":"capability.PortRange","EndSlotId":32,"StartPortId":32}` + c := `{"ClassId":"capability.PortRange","ObjectType":"capability.PortRange","StartSlotId":32,"EndPortId":32,"EndSlotId":32,"StartPortId":32}` //test when the response is empty ffOpEmpty := flattenListCapabilityPortRange(p, d) @@ -935,7 +935,7 @@ func TestFlattenListCapabilityPortRange(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilityPortRange(p, d) - expectedOp := []map[string]interface{}{{"start_slot_id": 32, "end_port_id": 32, "class_id": "capability.PortRange", "object_type": "capability.PortRange", "end_slot_id": 32, "start_port_id": 32}, {"start_slot_id": 32, "end_port_id": 32, "class_id": "capability.PortRange", "object_type": "capability.PortRange", "end_slot_id": 32, "start_port_id": 32}} + expectedOp := []map[string]interface{}{{"class_id": "capability.PortRange", "object_type": "capability.PortRange", "start_slot_id": 32, "end_port_id": 32, "end_slot_id": 32, "start_port_id": 32}, {"class_id": "capability.PortRange", "object_type": "capability.PortRange", "start_slot_id": 32, "end_port_id": 32, "end_slot_id": 32, "start_port_id": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -968,7 +968,7 @@ func TestFlattenListCapabilitySwitchingModeCapability(t *testing.T) { func TestFlattenListCertificatemanagementCertificateBase(t *testing.T) { p := []models.CertificatemanagementCertificateBase{} var d = &schema.ResourceData{} - c := `{"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","IsPrivatekeySet":true,"Enabled":true}` + c := `{"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","Enabled":true,"IsPrivatekeySet":true}` //test when the response is empty ffOpEmpty := flattenListCertificatemanagementCertificateBase(p, d) @@ -983,7 +983,7 @@ func TestFlattenListCertificatemanagementCertificateBase(t *testing.T) { p = append(p, x) } ffOp := flattenListCertificatemanagementCertificateBase(p, d) - expectedOp := []map[string]interface{}{{"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "is_privatekey_set": true, "enabled": true}, {"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "is_privatekey_set": true, "enabled": true}} + expectedOp := []map[string]interface{}{{"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}, {"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1016,7 +1016,7 @@ func TestFlattenListChassisConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { p := []models.ChassisConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListChassisConfigResultEntryRelationship(p, d) @@ -1031,7 +1031,7 @@ func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListChassisConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1040,7 +1040,7 @@ func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { func TestFlattenListChassisIomProfileRelationship(t *testing.T) { p := []models.ChassisIomProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListChassisIomProfileRelationship(p, d) @@ -1055,7 +1055,7 @@ func TestFlattenListChassisIomProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListChassisIomProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1064,7 +1064,7 @@ func TestFlattenListChassisIomProfileRelationship(t *testing.T) { func TestFlattenListCloudAwsSecurityGroupRelationship(t *testing.T) { p := []models.CloudAwsSecurityGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListCloudAwsSecurityGroupRelationship(p, d) @@ -1079,7 +1079,7 @@ func TestFlattenListCloudAwsSecurityGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudAwsSecurityGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1088,7 +1088,7 @@ func TestFlattenListCloudAwsSecurityGroupRelationship(t *testing.T) { func TestFlattenListCloudCloudTag(t *testing.T) { p := []models.CloudCloudTag{} var d = &schema.ResourceData{} - c := `{"Key":"Key %d","Value":"Value %d","ClassId":"cloud.CloudTag","ObjectType":"cloud.CloudTag"}` + c := `{"ObjectType":"cloud.CloudTag","ClassId":"cloud.CloudTag","Value":"Value %d","Key":"Key %d"}` //test when the response is empty ffOpEmpty := flattenListCloudCloudTag(p, d) @@ -1103,7 +1103,7 @@ func TestFlattenListCloudCloudTag(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudCloudTag(p, d) - expectedOp := []map[string]interface{}{{"key": "Key 1", "value": "Value 1", "class_id": "cloud.CloudTag", "object_type": "cloud.CloudTag"}, {"key": "Key 2", "value": "Value 2", "class_id": "cloud.CloudTag", "object_type": "cloud.CloudTag"}} + expectedOp := []map[string]interface{}{{"object_type": "cloud.CloudTag", "class_id": "cloud.CloudTag", "value": "Value 1", "key": "Key 1"}, {"object_type": "cloud.CloudTag", "class_id": "cloud.CloudTag", "value": "Value 2", "key": "Key 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1112,7 +1112,7 @@ func TestFlattenListCloudCloudTag(t *testing.T) { func TestFlattenListCloudCustomAttributes(t *testing.T) { p := []models.CloudCustomAttributes{} var d = &schema.ResourceData{} - c := `{"AttributeName":"AttributeName %d","AttributeType":"AttributeType %d","AttributeValue":"AttributeValue %d","ClassId":"cloud.CustomAttributes","ObjectType":"cloud.CustomAttributes"}` + c := `{"ClassId":"cloud.CustomAttributes","ObjectType":"cloud.CustomAttributes","AttributeName":"AttributeName %d","AttributeType":"AttributeType %d","AttributeValue":"AttributeValue %d"}` //test when the response is empty ffOpEmpty := flattenListCloudCustomAttributes(p, d) @@ -1127,7 +1127,7 @@ func TestFlattenListCloudCustomAttributes(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudCustomAttributes(p, d) - expectedOp := []map[string]interface{}{{"attribute_name": "AttributeName 1", "attribute_type": "AttributeType 1", "attribute_value": "AttributeValue 1", "class_id": "cloud.CustomAttributes", "object_type": "cloud.CustomAttributes"}, {"attribute_name": "AttributeName 2", "attribute_type": "AttributeType 2", "attribute_value": "AttributeValue 2", "class_id": "cloud.CustomAttributes", "object_type": "cloud.CustomAttributes"}} + expectedOp := []map[string]interface{}{{"class_id": "cloud.CustomAttributes", "object_type": "cloud.CustomAttributes", "attribute_name": "AttributeName 1", "attribute_type": "AttributeType 1", "attribute_value": "AttributeValue 1"}, {"class_id": "cloud.CustomAttributes", "object_type": "cloud.CustomAttributes", "attribute_name": "AttributeName 2", "attribute_type": "AttributeType 2", "attribute_value": "AttributeValue 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1136,7 +1136,7 @@ func TestFlattenListCloudCustomAttributes(t *testing.T) { func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { p := []models.CloudNetworkInterfaceAttachment{} var d = &schema.ResourceData{} - c := `{"ClassId":"cloud.NetworkInterfaceAttachment","ObjectType":"cloud.NetworkInterfaceAttachment","MacAddress":"MacAddress %d","NicIndex":32,"Identity":"Identity %d","NetworkName":"NetworkName %d","IpForwardingEnabled":true,"SubNetworkId":"SubNetworkId %d","NetworkId":"NetworkId %d","SubNetworkName":"SubNetworkName %d"}` + c := `{"ClassId":"cloud.NetworkInterfaceAttachment","NetworkId":"NetworkId %d","ObjectType":"cloud.NetworkInterfaceAttachment","Identity":"Identity %d","NicIndex":32,"SubNetworkId":"SubNetworkId %d","MacAddress":"MacAddress %d","SubNetworkName":"SubNetworkName %d","IpForwardingEnabled":true,"NetworkName":"NetworkName %d"}` //test when the response is empty ffOpEmpty := flattenListCloudNetworkInterfaceAttachment(p, d) @@ -1151,7 +1151,7 @@ func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudNetworkInterfaceAttachment(p, d) - expectedOp := []map[string]interface{}{{"class_id": "cloud.NetworkInterfaceAttachment", "object_type": "cloud.NetworkInterfaceAttachment", "mac_address": "MacAddress 1", "nic_index": 32, "identity": "Identity 1", "network_name": "NetworkName 1", "ip_forwarding_enabled": true, "sub_network_id": "SubNetworkId 1", "network_id": "NetworkId 1", "sub_network_name": "SubNetworkName 1"}, {"class_id": "cloud.NetworkInterfaceAttachment", "object_type": "cloud.NetworkInterfaceAttachment", "mac_address": "MacAddress 2", "nic_index": 32, "identity": "Identity 2", "network_name": "NetworkName 2", "ip_forwarding_enabled": true, "sub_network_id": "SubNetworkId 2", "network_id": "NetworkId 2", "sub_network_name": "SubNetworkName 2"}} + expectedOp := []map[string]interface{}{{"class_id": "cloud.NetworkInterfaceAttachment", "network_id": "NetworkId 1", "object_type": "cloud.NetworkInterfaceAttachment", "identity": "Identity 1", "nic_index": 32, "sub_network_id": "SubNetworkId 1", "mac_address": "MacAddress 1", "sub_network_name": "SubNetworkName 1", "ip_forwarding_enabled": true, "network_name": "NetworkName 1"}, {"class_id": "cloud.NetworkInterfaceAttachment", "network_id": "NetworkId 2", "object_type": "cloud.NetworkInterfaceAttachment", "identity": "Identity 2", "nic_index": 32, "sub_network_id": "SubNetworkId 2", "mac_address": "MacAddress 2", "sub_network_name": "SubNetworkName 2", "ip_forwarding_enabled": true, "network_name": "NetworkName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1160,7 +1160,7 @@ func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { func TestFlattenListCloudSecurityGroupRule(t *testing.T) { p := []models.CloudSecurityGroupRule{} var d = &schema.ResourceData{} - c := `{"StartPort":32,"EtherType":"EtherType %d","Description":"Description %d","Name":"Name %d","Protocol":"Protocol %d","ClassId":"cloud.SecurityGroupRule","Index":32,"SourceSecurityGroup":"SourceSecurityGroup %d","EndPort":32,"Identity":"Identity %d","Action":"Action %d","ObjectType":"cloud.SecurityGroupRule"}` + c := `{"StartPort":32,"SourceSecurityGroup":"SourceSecurityGroup %d","Protocol":"Protocol %d","Action":"Action %d","Identity":"Identity %d","EndPort":32,"Name":"Name %d","Index":32,"ObjectType":"cloud.SecurityGroupRule","Description":"Description %d","ClassId":"cloud.SecurityGroupRule","EtherType":"EtherType %d"}` //test when the response is empty ffOpEmpty := flattenListCloudSecurityGroupRule(p, d) @@ -1175,7 +1175,7 @@ func TestFlattenListCloudSecurityGroupRule(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudSecurityGroupRule(p, d) - expectedOp := []map[string]interface{}{{"start_port": 32, "ether_type": "EtherType 1", "description": "Description 1", "name": "Name 1", "protocol": "Protocol 1", "class_id": "cloud.SecurityGroupRule", "index": 32, "source_security_group": "SourceSecurityGroup 1", "end_port": 32, "identity": "Identity 1", "action": "Action 1", "object_type": "cloud.SecurityGroupRule"}, {"start_port": 32, "ether_type": "EtherType 2", "description": "Description 2", "name": "Name 2", "protocol": "Protocol 2", "class_id": "cloud.SecurityGroupRule", "index": 32, "source_security_group": "SourceSecurityGroup 2", "end_port": 32, "identity": "Identity 2", "action": "Action 2", "object_type": "cloud.SecurityGroupRule"}} + expectedOp := []map[string]interface{}{{"start_port": 32, "source_security_group": "SourceSecurityGroup 1", "protocol": "Protocol 1", "action": "Action 1", "identity": "Identity 1", "end_port": 32, "name": "Name 1", "index": 32, "object_type": "cloud.SecurityGroupRule", "description": "Description 1", "class_id": "cloud.SecurityGroupRule", "ether_type": "EtherType 1"}, {"start_port": 32, "source_security_group": "SourceSecurityGroup 2", "protocol": "Protocol 2", "action": "Action 2", "identity": "Identity 2", "end_port": 32, "name": "Name 2", "index": 32, "object_type": "cloud.SecurityGroupRule", "description": "Description 2", "class_id": "cloud.SecurityGroupRule", "ether_type": "EtherType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1184,7 +1184,7 @@ func TestFlattenListCloudSecurityGroupRule(t *testing.T) { func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { p := []models.CloudTfcWorkspaceVariables{} var d = &schema.ResourceData{} - c := `{"Hcl":true,"Key":"Key %d","Sensitive":true,"Value":"Value %d","Category":"Category %d","Identity":"Identity %d","ClassId":"cloud.TfcWorkspaceVariables","ObjectType":"cloud.TfcWorkspaceVariables","Description":"Description %d"}` + c := `{"Hcl":true,"Sensitive":true,"Description":"Description %d","ObjectType":"cloud.TfcWorkspaceVariables","Value":"Value %d","Key":"Key %d","Identity":"Identity %d","ClassId":"cloud.TfcWorkspaceVariables","Category":"Category %d"}` //test when the response is empty ffOpEmpty := flattenListCloudTfcWorkspaceVariables(p, d) @@ -1199,7 +1199,7 @@ func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudTfcWorkspaceVariables(p, d) - expectedOp := []map[string]interface{}{{"hcl": true, "key": "Key 1", "sensitive": true, "value": "Value 1", "category": "Category 1", "identity": "Identity 1", "class_id": "cloud.TfcWorkspaceVariables", "object_type": "cloud.TfcWorkspaceVariables", "description": "Description 1"}, {"hcl": true, "key": "Key 2", "sensitive": true, "value": "Value 2", "category": "Category 2", "identity": "Identity 2", "class_id": "cloud.TfcWorkspaceVariables", "object_type": "cloud.TfcWorkspaceVariables", "description": "Description 2"}} + expectedOp := []map[string]interface{}{{"hcl": true, "sensitive": true, "description": "Description 1", "object_type": "cloud.TfcWorkspaceVariables", "value": "Value 1", "key": "Key 1", "identity": "Identity 1", "class_id": "cloud.TfcWorkspaceVariables", "category": "Category 1"}, {"hcl": true, "sensitive": true, "description": "Description 2", "object_type": "cloud.TfcWorkspaceVariables", "value": "Value 2", "key": "Key 2", "identity": "Identity 2", "class_id": "cloud.TfcWorkspaceVariables", "category": "Category 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1208,7 +1208,7 @@ func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { func TestFlattenListCloudVolumeAttachment(t *testing.T) { p := []models.CloudVolumeAttachment{} var d = &schema.ResourceData{} - c := `{"Index":32,"ObjectType":"cloud.VolumeAttachment","IsRoot":true,"Identity":"Identity %d","ClassId":"cloud.VolumeAttachment","DeviceName":"DeviceName %d","AutoDelete":true}` + c := `{"DeviceName":"DeviceName %d","ObjectType":"cloud.VolumeAttachment","IsRoot":true,"AutoDelete":true,"ClassId":"cloud.VolumeAttachment","Index":32,"Identity":"Identity %d"}` //test when the response is empty ffOpEmpty := flattenListCloudVolumeAttachment(p, d) @@ -1223,7 +1223,7 @@ func TestFlattenListCloudVolumeAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudVolumeAttachment(p, d) - expectedOp := []map[string]interface{}{{"index": 32, "object_type": "cloud.VolumeAttachment", "is_root": true, "identity": "Identity 1", "class_id": "cloud.VolumeAttachment", "device_name": "DeviceName 1", "auto_delete": true}, {"index": 32, "object_type": "cloud.VolumeAttachment", "is_root": true, "identity": "Identity 2", "class_id": "cloud.VolumeAttachment", "device_name": "DeviceName 2", "auto_delete": true}} + expectedOp := []map[string]interface{}{{"device_name": "DeviceName 1", "object_type": "cloud.VolumeAttachment", "is_root": true, "auto_delete": true, "class_id": "cloud.VolumeAttachment", "index": 32, "identity": "Identity 1"}, {"device_name": "DeviceName 2", "object_type": "cloud.VolumeAttachment", "is_root": true, "auto_delete": true, "class_id": "cloud.VolumeAttachment", "index": 32, "identity": "Identity 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1232,7 +1232,7 @@ func TestFlattenListCloudVolumeAttachment(t *testing.T) { func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { p := []models.CloudVolumeInstanceAttachment{} var d = &schema.ResourceData{} - c := `{"InstanceId":"InstanceId %d","State":"State %d","AutoDelete":true,"ClassId":"cloud.VolumeInstanceAttachment","ObjectType":"cloud.VolumeInstanceAttachment","DeviceName":"DeviceName %d"}` + c := `{"State":"State %d","ObjectType":"cloud.VolumeInstanceAttachment","ClassId":"cloud.VolumeInstanceAttachment","AutoDelete":true,"DeviceName":"DeviceName %d","InstanceId":"InstanceId %d"}` //test when the response is empty ffOpEmpty := flattenListCloudVolumeInstanceAttachment(p, d) @@ -1247,7 +1247,7 @@ func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudVolumeInstanceAttachment(p, d) - expectedOp := []map[string]interface{}{{"instance_id": "InstanceId 1", "state": "State 1", "auto_delete": true, "class_id": "cloud.VolumeInstanceAttachment", "object_type": "cloud.VolumeInstanceAttachment", "device_name": "DeviceName 1"}, {"instance_id": "InstanceId 2", "state": "State 2", "auto_delete": true, "class_id": "cloud.VolumeInstanceAttachment", "object_type": "cloud.VolumeInstanceAttachment", "device_name": "DeviceName 2"}} + expectedOp := []map[string]interface{}{{"state": "State 1", "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "auto_delete": true, "device_name": "DeviceName 1", "instance_id": "InstanceId 1"}, {"state": "State 2", "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "auto_delete": true, "device_name": "DeviceName 2", "instance_id": "InstanceId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1256,7 +1256,7 @@ func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { func TestFlattenListComputeBladeRelationship(t *testing.T) { p := []models.ComputeBladeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListComputeBladeRelationship(p, d) @@ -1271,7 +1271,7 @@ func TestFlattenListComputeBladeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeBladeRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1280,7 +1280,7 @@ func TestFlattenListComputeBladeRelationship(t *testing.T) { func TestFlattenListComputeIpAddress(t *testing.T) { p := []models.ComputeIpAddress{} var d = &schema.ResourceData{} - c := `{"HttpsPort":32,"KvmVlan":32,"Address":"Address %d","KvmPort":32,"ClassId":"compute.IpAddress","Category":"Category %d","HttpPort":32,"ObjectType":"compute.IpAddress","Name":"Name %d","Subnet":"Subnet %d","Dn":"Dn %d","Type":"Type %d","DefaultGateway":"DefaultGateway %d"}` + c := `{"ClassId":"compute.IpAddress","Category":"Category %d","Name":"Name %d","Dn":"Dn %d","KvmVlan":32,"ObjectType":"compute.IpAddress","HttpPort":32,"KvmPort":32,"Address":"Address %d","Subnet":"Subnet %d","DefaultGateway":"DefaultGateway %d","HttpsPort":32,"Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListComputeIpAddress(p, d) @@ -1295,7 +1295,7 @@ func TestFlattenListComputeIpAddress(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeIpAddress(p, d) - expectedOp := []map[string]interface{}{{"https_port": 32, "kvm_vlan": 32, "address": "Address 1", "kvm_port": 32, "class_id": "compute.IpAddress", "category": "Category 1", "http_port": 32, "object_type": "compute.IpAddress", "name": "Name 1", "subnet": "Subnet 1", "dn": "Dn 1", "type": "Type 1", "default_gateway": "DefaultGateway 1"}, {"https_port": 32, "kvm_vlan": 32, "address": "Address 2", "kvm_port": 32, "class_id": "compute.IpAddress", "category": "Category 2", "http_port": 32, "object_type": "compute.IpAddress", "name": "Name 2", "subnet": "Subnet 2", "dn": "Dn 2", "type": "Type 2", "default_gateway": "DefaultGateway 2"}} + expectedOp := []map[string]interface{}{{"class_id": "compute.IpAddress", "category": "Category 1", "name": "Name 1", "dn": "Dn 1", "kvm_vlan": 32, "object_type": "compute.IpAddress", "http_port": 32, "kvm_port": 32, "address": "Address 1", "subnet": "Subnet 1", "default_gateway": "DefaultGateway 1", "https_port": 32, "type": "Type 1"}, {"class_id": "compute.IpAddress", "category": "Category 2", "name": "Name 2", "dn": "Dn 2", "kvm_vlan": 32, "object_type": "compute.IpAddress", "http_port": 32, "kvm_port": 32, "address": "Address 2", "subnet": "Subnet 2", "default_gateway": "DefaultGateway 2", "https_port": 32, "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1352,7 +1352,7 @@ func TestFlattenListComputePhysicalRelationship(t *testing.T) { func TestFlattenListComputeRackUnitRelationship(t *testing.T) { p := []models.ComputeRackUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListComputeRackUnitRelationship(p, d) @@ -1367,7 +1367,7 @@ func TestFlattenListComputeRackUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeRackUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1376,7 +1376,7 @@ func TestFlattenListComputeRackUnitRelationship(t *testing.T) { func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { p := []models.CondHclStatusDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListCondHclStatusDetailRelationship(p, d) @@ -1391,7 +1391,7 @@ func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListCondHclStatusDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1400,7 +1400,7 @@ func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { func TestFlattenListConfigExportedItemRelationship(t *testing.T) { p := []models.ConfigExportedItemRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListConfigExportedItemRelationship(p, d) @@ -1415,7 +1415,7 @@ func TestFlattenListConfigExportedItemRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListConfigExportedItemRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1472,7 +1472,7 @@ func TestFlattenListConfigMoRef(t *testing.T) { func TestFlattenListConnectorpackConnectorPackUpdate(t *testing.T) { p := []models.ConnectorpackConnectorPackUpdate{} var d = &schema.ResourceData{} - c := `{"NewVersion":"NewVersion %d","CurrentVersion":"CurrentVersion %d","Name":"Name %d","ClassId":"connectorpack.ConnectorPackUpdate","ObjectType":"connectorpack.ConnectorPackUpdate"}` + c := `{"ClassId":"connectorpack.ConnectorPackUpdate","ObjectType":"connectorpack.ConnectorPackUpdate","CurrentVersion":"CurrentVersion %d","Name":"Name %d","NewVersion":"NewVersion %d"}` //test when the response is empty ffOpEmpty := flattenListConnectorpackConnectorPackUpdate(p, d) @@ -1487,7 +1487,7 @@ func TestFlattenListConnectorpackConnectorPackUpdate(t *testing.T) { p = append(p, x) } ffOp := flattenListConnectorpackConnectorPackUpdate(p, d) - expectedOp := []map[string]interface{}{{"new_version": "NewVersion 1", "current_version": "CurrentVersion 1", "name": "Name 1", "class_id": "connectorpack.ConnectorPackUpdate", "object_type": "connectorpack.ConnectorPackUpdate"}, {"new_version": "NewVersion 2", "current_version": "CurrentVersion 2", "name": "Name 2", "class_id": "connectorpack.ConnectorPackUpdate", "object_type": "connectorpack.ConnectorPackUpdate"}} + expectedOp := []map[string]interface{}{{"class_id": "connectorpack.ConnectorPackUpdate", "object_type": "connectorpack.ConnectorPackUpdate", "current_version": "CurrentVersion 1", "name": "Name 1", "new_version": "NewVersion 1"}, {"class_id": "connectorpack.ConnectorPackUpdate", "object_type": "connectorpack.ConnectorPackUpdate", "current_version": "CurrentVersion 2", "name": "Name 2", "new_version": "NewVersion 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1496,7 +1496,7 @@ func TestFlattenListConnectorpackConnectorPackUpdate(t *testing.T) { func TestFlattenListContentComplexType(t *testing.T) { p := []models.ContentComplexType{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ClassId":"content.ComplexType","ObjectType":"content.ComplexType"}` + c := `{"ClassId":"content.ComplexType","ObjectType":"content.ComplexType","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListContentComplexType(p, d) @@ -1511,7 +1511,7 @@ func TestFlattenListContentComplexType(t *testing.T) { p = append(p, x) } ffOp := flattenListContentComplexType(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "class_id": "content.ComplexType", "object_type": "content.ComplexType"}, {"name": "Name 2", "class_id": "content.ComplexType", "object_type": "content.ComplexType"}} + expectedOp := []map[string]interface{}{{"class_id": "content.ComplexType", "object_type": "content.ComplexType", "name": "Name 1"}, {"class_id": "content.ComplexType", "object_type": "content.ComplexType", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1520,7 +1520,7 @@ func TestFlattenListContentComplexType(t *testing.T) { func TestFlattenListContentParameter(t *testing.T) { p := []models.ContentParameter{} var d = &schema.ResourceData{} - c := `{"Type":"Type %d","ItemType":"ItemType %d","ComplexType":"ComplexType %d","Secure":true,"Path":"Path %d","Name":"Name %d","AcceptSingleValue":true,"ClassId":"content.Parameter","ObjectType":"content.Parameter"}` + c := `{"Secure":true,"ComplexType":"ComplexType %d","ClassId":"content.Parameter","Path":"Path %d","AcceptSingleValue":true,"ItemType":"ItemType %d","Name":"Name %d","ObjectType":"content.Parameter","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListContentParameter(p, d) @@ -1535,7 +1535,7 @@ func TestFlattenListContentParameter(t *testing.T) { p = append(p, x) } ffOp := flattenListContentParameter(p, d) - expectedOp := []map[string]interface{}{{"type": "Type 1", "item_type": "ItemType 1", "complex_type": "ComplexType 1", "secure": true, "path": "Path 1", "name": "Name 1", "accept_single_value": true, "class_id": "content.Parameter", "object_type": "content.Parameter"}, {"type": "Type 2", "item_type": "ItemType 2", "complex_type": "ComplexType 2", "secure": true, "path": "Path 2", "name": "Name 2", "accept_single_value": true, "class_id": "content.Parameter", "object_type": "content.Parameter"}} + expectedOp := []map[string]interface{}{{"secure": true, "complex_type": "ComplexType 1", "class_id": "content.Parameter", "path": "Path 1", "accept_single_value": true, "item_type": "ItemType 1", "name": "Name 1", "object_type": "content.Parameter", "type": "Type 1"}, {"secure": true, "complex_type": "ComplexType 2", "class_id": "content.Parameter", "path": "Path 2", "accept_single_value": true, "item_type": "ItemType 2", "name": "Name 2", "object_type": "content.Parameter", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1544,7 +1544,7 @@ func TestFlattenListContentParameter(t *testing.T) { func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { p := []models.CrdCustomResourceConfigProperty{} var d = &schema.ResourceData{} - c := `{"Key":"Key %d","ClassId":"crd.CustomResourceConfigProperty","ObjectType":"crd.CustomResourceConfigProperty","Value":"Value %d"}` + c := `{"Value":"Value %d","ClassId":"crd.CustomResourceConfigProperty","ObjectType":"crd.CustomResourceConfigProperty","Key":"Key %d"}` //test when the response is empty ffOpEmpty := flattenListCrdCustomResourceConfigProperty(p, d) @@ -1559,7 +1559,7 @@ func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { p = append(p, x) } ffOp := flattenListCrdCustomResourceConfigProperty(p, d) - expectedOp := []map[string]interface{}{{"key": "Key 1", "class_id": "crd.CustomResourceConfigProperty", "object_type": "crd.CustomResourceConfigProperty", "value": "Value 1"}, {"key": "Key 2", "class_id": "crd.CustomResourceConfigProperty", "object_type": "crd.CustomResourceConfigProperty", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"value": "Value 1", "class_id": "crd.CustomResourceConfigProperty", "object_type": "crd.CustomResourceConfigProperty", "key": "Key 1"}, {"value": "Value 2", "class_id": "crd.CustomResourceConfigProperty", "object_type": "crd.CustomResourceConfigProperty", "key": "Key 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1568,7 +1568,7 @@ func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { func TestFlattenListEquipmentFanRelationship(t *testing.T) { p := []models.EquipmentFanRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentFanRelationship(p, d) @@ -1583,7 +1583,7 @@ func TestFlattenListEquipmentFanRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentFanRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1592,7 +1592,7 @@ func TestFlattenListEquipmentFanRelationship(t *testing.T) { func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { p := []models.EquipmentFanModuleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentFanModuleRelationship(p, d) @@ -1607,7 +1607,7 @@ func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentFanModuleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1616,7 +1616,7 @@ func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { p := []models.EquipmentIoCardRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoCardRelationship(p, d) @@ -1631,7 +1631,7 @@ func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1640,7 +1640,7 @@ func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { p := []models.EquipmentIoCardIdentity{} var d = &schema.ResourceData{} - c := `{"NetworkElementMoid":"NetworkElementMoid %d","SwitchId":32,"IoCardMoid":"IoCardMoid %d","ModuleId":32,"ClassId":"equipment.IoCardIdentity","ObjectType":"equipment.IoCardIdentity"}` + c := `{"SwitchId":32,"IoCardMoid":"IoCardMoid %d","ModuleId":32,"NetworkElementMoid":"NetworkElementMoid %d","ClassId":"equipment.IoCardIdentity","ObjectType":"equipment.IoCardIdentity"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoCardIdentity(p, d) @@ -1655,7 +1655,7 @@ func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoCardIdentity(p, d) - expectedOp := []map[string]interface{}{{"network_element_moid": "NetworkElementMoid 1", "switch_id": 32, "io_card_moid": "IoCardMoid 1", "module_id": 32, "class_id": "equipment.IoCardIdentity", "object_type": "equipment.IoCardIdentity"}, {"network_element_moid": "NetworkElementMoid 2", "switch_id": 32, "io_card_moid": "IoCardMoid 2", "module_id": 32, "class_id": "equipment.IoCardIdentity", "object_type": "equipment.IoCardIdentity"}} + expectedOp := []map[string]interface{}{{"switch_id": 32, "io_card_moid": "IoCardMoid 1", "module_id": 32, "network_element_moid": "NetworkElementMoid 1", "class_id": "equipment.IoCardIdentity", "object_type": "equipment.IoCardIdentity"}, {"switch_id": 32, "io_card_moid": "IoCardMoid 2", "module_id": 32, "network_element_moid": "NetworkElementMoid 2", "class_id": "equipment.IoCardIdentity", "object_type": "equipment.IoCardIdentity"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1664,7 +1664,7 @@ func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { p := []models.EquipmentIoExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoExpanderRelationship(p, d) @@ -1679,7 +1679,7 @@ func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoExpanderRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1688,7 +1688,7 @@ func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { func TestFlattenListEquipmentPsuRelationship(t *testing.T) { p := []models.EquipmentPsuRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentPsuRelationship(p, d) @@ -1703,7 +1703,7 @@ func TestFlattenListEquipmentPsuRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentPsuRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1712,7 +1712,7 @@ func TestFlattenListEquipmentPsuRelationship(t *testing.T) { func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { p := []models.EquipmentRackEnclosureSlotRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentRackEnclosureSlotRelationship(p, d) @@ -1727,7 +1727,7 @@ func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentRackEnclosureSlotRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1736,7 +1736,7 @@ func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { p := []models.EquipmentSwitchCardRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentSwitchCardRelationship(p, d) @@ -1751,7 +1751,7 @@ func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentSwitchCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1760,7 +1760,7 @@ func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { p := []models.EquipmentSystemIoControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentSystemIoControllerRelationship(p, d) @@ -1775,7 +1775,7 @@ func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentSystemIoControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1784,7 +1784,7 @@ func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { func TestFlattenListEquipmentTpmRelationship(t *testing.T) { p := []models.EquipmentTpmRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentTpmRelationship(p, d) @@ -1799,7 +1799,7 @@ func TestFlattenListEquipmentTpmRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentTpmRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1808,7 +1808,7 @@ func TestFlattenListEquipmentTpmRelationship(t *testing.T) { func TestFlattenListEtherHostPortRelationship(t *testing.T) { p := []models.EtherHostPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEtherHostPortRelationship(p, d) @@ -1823,7 +1823,7 @@ func TestFlattenListEtherHostPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherHostPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1832,7 +1832,7 @@ func TestFlattenListEtherHostPortRelationship(t *testing.T) { func TestFlattenListEtherNetworkPortRelationship(t *testing.T) { p := []models.EtherNetworkPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEtherNetworkPortRelationship(p, d) @@ -1847,7 +1847,7 @@ func TestFlattenListEtherNetworkPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherNetworkPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1880,7 +1880,7 @@ func TestFlattenListEtherPhysicalPortRelationship(t *testing.T) { func TestFlattenListEtherPortChannelRelationship(t *testing.T) { p := []models.EtherPortChannelRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListEtherPortChannelRelationship(p, d) @@ -1895,7 +1895,7 @@ func TestFlattenListEtherPortChannelRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherPortChannelRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1904,7 +1904,7 @@ func TestFlattenListEtherPortChannelRelationship(t *testing.T) { func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { p := []models.FabricConfigChangeDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFabricConfigChangeDetailRelationship(p, d) @@ -1919,7 +1919,7 @@ func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricConfigChangeDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1928,7 +1928,7 @@ func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { p := []models.FabricConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFabricConfigResultEntryRelationship(p, d) @@ -1943,7 +1943,7 @@ func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1952,7 +1952,7 @@ func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p := []models.FabricEthNetworkGroupPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFabricEthNetworkGroupPolicyRelationship(p, d) @@ -1967,7 +1967,7 @@ func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricEthNetworkGroupPolicyRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1976,7 +1976,7 @@ func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { func TestFlattenListFabricPortIdentifier(t *testing.T) { p := []models.FabricPortIdentifier{} var d = &schema.ResourceData{} - c := `{"ObjectType":"fabric.PortIdentifier","PortId":32,"SlotId":32,"AggregatePortId":32,"ClassId":"fabric.PortIdentifier"}` + c := `{"SlotId":32,"AggregatePortId":32,"ClassId":"fabric.PortIdentifier","ObjectType":"fabric.PortIdentifier","PortId":32}` //test when the response is empty ffOpEmpty := flattenListFabricPortIdentifier(p, d) @@ -1991,7 +1991,7 @@ func TestFlattenListFabricPortIdentifier(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricPortIdentifier(p, d) - expectedOp := []map[string]interface{}{{"object_type": "fabric.PortIdentifier", "port_id": 32, "slot_id": 32, "aggregate_port_id": 32, "class_id": "fabric.PortIdentifier"}, {"object_type": "fabric.PortIdentifier", "port_id": 32, "slot_id": 32, "aggregate_port_id": 32, "class_id": "fabric.PortIdentifier"}} + expectedOp := []map[string]interface{}{{"slot_id": 32, "aggregate_port_id": 32, "class_id": "fabric.PortIdentifier", "object_type": "fabric.PortIdentifier", "port_id": 32}, {"slot_id": 32, "aggregate_port_id": 32, "class_id": "fabric.PortIdentifier", "object_type": "fabric.PortIdentifier", "port_id": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2000,7 +2000,7 @@ func TestFlattenListFabricPortIdentifier(t *testing.T) { func TestFlattenListFabricQosClass(t *testing.T) { p := []models.FabricQosClass{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"fabric.QosClass","Cos":32,"BandwidthPercent":32,"MulticastOptimize":true,"PacketDrop":true,"Mtu":32,"ClassId":"fabric.QosClass","AdminState":"AdminState %d","Weight":32}` + c := `{"MulticastOptimize":true,"Cos":32,"ClassId":"fabric.QosClass","Weight":32,"BandwidthPercent":32,"Mtu":32,"PacketDrop":true,"ObjectType":"fabric.QosClass","AdminState":"AdminState %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListFabricQosClass(p, d) @@ -2015,7 +2015,7 @@ func TestFlattenListFabricQosClass(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricQosClass(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "fabric.QosClass", "cos": 32, "bandwidth_percent": 32, "multicast_optimize": true, "packet_drop": true, "mtu": 32, "class_id": "fabric.QosClass", "admin_state": "AdminState 1", "weight": 32}, {"name": "Name 2", "object_type": "fabric.QosClass", "cos": 32, "bandwidth_percent": 32, "multicast_optimize": true, "packet_drop": true, "mtu": 32, "class_id": "fabric.QosClass", "admin_state": "AdminState 2", "weight": 32}} + expectedOp := []map[string]interface{}{{"multicast_optimize": true, "cos": 32, "class_id": "fabric.QosClass", "weight": 32, "bandwidth_percent": 32, "mtu": 32, "packet_drop": true, "object_type": "fabric.QosClass", "admin_state": "AdminState 1", "name": "Name 1"}, {"multicast_optimize": true, "cos": 32, "class_id": "fabric.QosClass", "weight": 32, "bandwidth_percent": 32, "mtu": 32, "packet_drop": true, "object_type": "fabric.QosClass", "admin_state": "AdminState 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2024,7 +2024,7 @@ func TestFlattenListFabricQosClass(t *testing.T) { func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { p := []models.FabricSwitchProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFabricSwitchProfileRelationship(p, d) @@ -2039,7 +2039,7 @@ func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricSwitchProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2048,7 +2048,7 @@ func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { func TestFlattenListFcPhysicalPortRelationship(t *testing.T) { p := []models.FcPhysicalPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListFcPhysicalPortRelationship(p, d) @@ -2063,7 +2063,7 @@ func TestFlattenListFcPhysicalPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFcPhysicalPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2072,7 +2072,7 @@ func TestFlattenListFcPhysicalPortRelationship(t *testing.T) { func TestFlattenListFcPortChannelRelationship(t *testing.T) { p := []models.FcPortChannelRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFcPortChannelRelationship(p, d) @@ -2087,7 +2087,7 @@ func TestFlattenListFcPortChannelRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFcPortChannelRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2096,7 +2096,7 @@ func TestFlattenListFcPortChannelRelationship(t *testing.T) { func TestFlattenListFcpoolBlock(t *testing.T) { p := []models.FcpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"fcpool.Block","ObjectType":"fcpool.Block","Size":32,"From":"From %d","To":"To %d"}` + c := `{"Size":32,"From":"From %d","To":"To %d","ClassId":"fcpool.Block","ObjectType":"fcpool.Block"}` //test when the response is empty ffOpEmpty := flattenListFcpoolBlock(p, d) @@ -2111,7 +2111,7 @@ func TestFlattenListFcpoolBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListFcpoolBlock(p, d) - expectedOp := []map[string]interface{}{{"class_id": "fcpool.Block", "object_type": "fcpool.Block", "size": 32, "from": "From 1", "to": "To 1"}, {"class_id": "fcpool.Block", "object_type": "fcpool.Block", "size": 32, "from": "From 2", "to": "To 2"}} + expectedOp := []map[string]interface{}{{"size": 32, "from": "From 1", "to": "To 1", "class_id": "fcpool.Block", "object_type": "fcpool.Block"}, {"size": 32, "from": "From 2", "to": "To 2", "class_id": "fcpool.Block", "object_type": "fcpool.Block"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2144,7 +2144,7 @@ func TestFlattenListFcpoolFcBlockRelationship(t *testing.T) { func TestFlattenListFirmwareBaseImpact(t *testing.T) { p := []models.FirmwareBaseImpact{} var d = &schema.ResourceData{} - c := `{"ObjectType":"firmware.BaseImpact","VersionImpact":"VersionImpact %d","EndPoint":"EndPoint %d","ImpactType":"ImpactType %d","ComputationError":"ComputationError %d","ClassId":"firmware.BaseImpact","TargetFirmwareVersion":"TargetFirmwareVersion %d","ComputationStatusDetail":"ComputationStatusDetail %d","DomainName":"DomainName %d","FirmwareVersion":"FirmwareVersion %d","Model":"Model %d"}` + c := `{"ComputationError":"ComputationError %d","EndPoint":"EndPoint %d","ImpactType":"ImpactType %d","FirmwareVersion":"FirmwareVersion %d","Model":"Model %d","ObjectType":"firmware.BaseImpact","DomainName":"DomainName %d","VersionImpact":"VersionImpact %d","ClassId":"firmware.BaseImpact","TargetFirmwareVersion":"TargetFirmwareVersion %d","ComputationStatusDetail":"ComputationStatusDetail %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareBaseImpact(p, d) @@ -2159,7 +2159,7 @@ func TestFlattenListFirmwareBaseImpact(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareBaseImpact(p, d) - expectedOp := []map[string]interface{}{{"object_type": "firmware.BaseImpact", "version_impact": "VersionImpact 1", "end_point": "EndPoint 1", "impact_type": "ImpactType 1", "computation_error": "ComputationError 1", "class_id": "firmware.BaseImpact", "target_firmware_version": "TargetFirmwareVersion 1", "computation_status_detail": "ComputationStatusDetail 1", "domain_name": "DomainName 1", "firmware_version": "FirmwareVersion 1", "model": "Model 1"}, {"object_type": "firmware.BaseImpact", "version_impact": "VersionImpact 2", "end_point": "EndPoint 2", "impact_type": "ImpactType 2", "computation_error": "ComputationError 2", "class_id": "firmware.BaseImpact", "target_firmware_version": "TargetFirmwareVersion 2", "computation_status_detail": "ComputationStatusDetail 2", "domain_name": "DomainName 2", "firmware_version": "FirmwareVersion 2", "model": "Model 2"}} + expectedOp := []map[string]interface{}{{"computation_error": "ComputationError 1", "end_point": "EndPoint 1", "impact_type": "ImpactType 1", "firmware_version": "FirmwareVersion 1", "model": "Model 1", "object_type": "firmware.BaseImpact", "domain_name": "DomainName 1", "version_impact": "VersionImpact 1", "class_id": "firmware.BaseImpact", "target_firmware_version": "TargetFirmwareVersion 1", "computation_status_detail": "ComputationStatusDetail 1"}, {"computation_error": "ComputationError 2", "end_point": "EndPoint 2", "impact_type": "ImpactType 2", "firmware_version": "FirmwareVersion 2", "model": "Model 2", "object_type": "firmware.BaseImpact", "domain_name": "DomainName 2", "version_impact": "VersionImpact 2", "class_id": "firmware.BaseImpact", "target_firmware_version": "TargetFirmwareVersion 2", "computation_status_detail": "ComputationStatusDetail 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2168,7 +2168,7 @@ func TestFlattenListFirmwareBaseImpact(t *testing.T) { func TestFlattenListFirmwareComponentMeta(t *testing.T) { p := []models.FirmwareComponentMeta{} var d = &schema.ResourceData{} - c := `{"Disruption":"Disruption %d","ClassId":"firmware.ComponentMeta","ObjectType":"firmware.ComponentMeta","Description":"Description %d","ImagePath":"ImagePath %d","RedfishUrl":"RedfishUrl %d","Vendor":"Vendor %d","IsOobSupported":true,"Model":"Model %d","PackedVersion":"PackedVersion %d","ComponentLabel":"ComponentLabel %d","ComponentType":"ComponentType %d"}` + c := `{"RedfishUrl":"RedfishUrl %d","Model":"Model %d","IsOobSupported":true,"ObjectType":"firmware.ComponentMeta","Vendor":"Vendor %d","PackedVersion":"PackedVersion %d","ClassId":"firmware.ComponentMeta","ComponentType":"ComponentType %d","Description":"Description %d","Disruption":"Disruption %d","ComponentLabel":"ComponentLabel %d","ImagePath":"ImagePath %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareComponentMeta(p, d) @@ -2183,7 +2183,7 @@ func TestFlattenListFirmwareComponentMeta(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareComponentMeta(p, d) - expectedOp := []map[string]interface{}{{"disruption": "Disruption 1", "class_id": "firmware.ComponentMeta", "object_type": "firmware.ComponentMeta", "description": "Description 1", "image_path": "ImagePath 1", "redfish_url": "RedfishUrl 1", "vendor": "Vendor 1", "is_oob_supported": true, "model": "Model 1", "packed_version": "PackedVersion 1", "component_label": "ComponentLabel 1", "component_type": "ComponentType 1"}, {"disruption": "Disruption 2", "class_id": "firmware.ComponentMeta", "object_type": "firmware.ComponentMeta", "description": "Description 2", "image_path": "ImagePath 2", "redfish_url": "RedfishUrl 2", "vendor": "Vendor 2", "is_oob_supported": true, "model": "Model 2", "packed_version": "PackedVersion 2", "component_label": "ComponentLabel 2", "component_type": "ComponentType 2"}} + expectedOp := []map[string]interface{}{{"redfish_url": "RedfishUrl 1", "model": "Model 1", "is_oob_supported": true, "object_type": "firmware.ComponentMeta", "vendor": "Vendor 1", "packed_version": "PackedVersion 1", "class_id": "firmware.ComponentMeta", "component_type": "ComponentType 1", "description": "Description 1", "disruption": "Disruption 1", "component_label": "ComponentLabel 1", "image_path": "ImagePath 1"}, {"redfish_url": "RedfishUrl 2", "model": "Model 2", "is_oob_supported": true, "object_type": "firmware.ComponentMeta", "vendor": "Vendor 2", "packed_version": "PackedVersion 2", "class_id": "firmware.ComponentMeta", "component_type": "ComponentType 2", "description": "Description 2", "disruption": "Disruption 2", "component_label": "ComponentLabel 2", "image_path": "ImagePath 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2216,7 +2216,7 @@ func TestFlattenListFirmwareDistributableMetaRelationship(t *testing.T) { func TestFlattenListFirmwareFirmwareInventory(t *testing.T) { p := []models.FirmwareFirmwareInventory{} var d = &schema.ResourceData{} - c := `{"ClassId":"firmware.FirmwareInventory","Category":"Category %d","Model":"Model %d","Vendor":"Vendor %d","Version":"Version %d","Label":"Label %d","ObjectType":"firmware.FirmwareInventory","UpdateUri":"UpdateUri %d"}` + c := `{"Model":"Model %d","ClassId":"firmware.FirmwareInventory","Version":"Version %d","Category":"Category %d","Vendor":"Vendor %d","Label":"Label %d","ObjectType":"firmware.FirmwareInventory","UpdateUri":"UpdateUri %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareFirmwareInventory(p, d) @@ -2231,7 +2231,7 @@ func TestFlattenListFirmwareFirmwareInventory(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareFirmwareInventory(p, d) - expectedOp := []map[string]interface{}{{"class_id": "firmware.FirmwareInventory", "category": "Category 1", "model": "Model 1", "vendor": "Vendor 1", "nr_version": "Version 1", "label": "Label 1", "object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 1"}, {"class_id": "firmware.FirmwareInventory", "category": "Category 2", "model": "Model 2", "vendor": "Vendor 2", "nr_version": "Version 2", "label": "Label 2", "object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 2"}} + expectedOp := []map[string]interface{}{{"model": "Model 1", "class_id": "firmware.FirmwareInventory", "nr_version": "Version 1", "category": "Category 1", "vendor": "Vendor 1", "label": "Label 1", "object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 1"}, {"model": "Model 2", "class_id": "firmware.FirmwareInventory", "nr_version": "Version 2", "category": "Category 2", "vendor": "Vendor 2", "label": "Label 2", "object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2240,7 +2240,7 @@ func TestFlattenListFirmwareFirmwareInventory(t *testing.T) { func TestFlattenListFirmwareRunningFirmwareRelationship(t *testing.T) { p := []models.FirmwareRunningFirmwareRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareRunningFirmwareRelationship(p, d) @@ -2255,7 +2255,7 @@ func TestFlattenListFirmwareRunningFirmwareRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareRunningFirmwareRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2264,7 +2264,7 @@ func TestFlattenListFirmwareRunningFirmwareRelationship(t *testing.T) { func TestFlattenListForecastDefinitionRelationship(t *testing.T) { p := []models.ForecastDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListForecastDefinitionRelationship(p, d) @@ -2279,7 +2279,7 @@ func TestFlattenListForecastDefinitionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListForecastDefinitionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2288,7 +2288,7 @@ func TestFlattenListForecastDefinitionRelationship(t *testing.T) { func TestFlattenListGraphicsCardRelationship(t *testing.T) { p := []models.GraphicsCardRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListGraphicsCardRelationship(p, d) @@ -2303,7 +2303,7 @@ func TestFlattenListGraphicsCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListGraphicsCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2360,7 +2360,7 @@ func TestFlattenListHclConstraint(t *testing.T) { func TestFlattenListHclHyperflexSoftwareCompatibilityInfoRelationship(t *testing.T) { p := []models.HclHyperflexSoftwareCompatibilityInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHclHyperflexSoftwareCompatibilityInfoRelationship(p, d) @@ -2375,7 +2375,7 @@ func TestFlattenListHclHyperflexSoftwareCompatibilityInfoRelationship(t *testing p = append(p, x) } ffOp := flattenListHclHyperflexSoftwareCompatibilityInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2384,7 +2384,7 @@ func TestFlattenListHclHyperflexSoftwareCompatibilityInfoRelationship(t *testing func TestFlattenListHclOperatingSystemRelationship(t *testing.T) { p := []models.HclOperatingSystemRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHclOperatingSystemRelationship(p, d) @@ -2399,7 +2399,7 @@ func TestFlattenListHclOperatingSystemRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHclOperatingSystemRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2408,7 +2408,7 @@ func TestFlattenListHclOperatingSystemRelationship(t *testing.T) { func TestFlattenListHyperflexAlarmRelationship(t *testing.T) { p := []models.HyperflexAlarmRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexAlarmRelationship(p, d) @@ -2423,7 +2423,7 @@ func TestFlattenListHyperflexAlarmRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexAlarmRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2432,7 +2432,7 @@ func TestFlattenListHyperflexAlarmRelationship(t *testing.T) { func TestFlattenListHyperflexBaseClusterRelationship(t *testing.T) { p := []models.HyperflexBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexBaseClusterRelationship(p, d) @@ -2447,7 +2447,7 @@ func TestFlattenListHyperflexBaseClusterRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexBaseClusterRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2456,7 +2456,7 @@ func TestFlattenListHyperflexBaseClusterRelationship(t *testing.T) { func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { p := []models.HyperflexCapabilityInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexCapabilityInfoRelationship(p, d) @@ -2471,7 +2471,7 @@ func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexCapabilityInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2480,7 +2480,7 @@ func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { func TestFlattenListHyperflexClusterProfileRelationship(t *testing.T) { p := []models.HyperflexClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexClusterProfileRelationship(p, d) @@ -2495,7 +2495,7 @@ func TestFlattenListHyperflexClusterProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexClusterProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2528,7 +2528,7 @@ func TestFlattenListHyperflexConfigResultEntryRelationship(t *testing.T) { func TestFlattenListHyperflexDriveRelationship(t *testing.T) { p := []models.HyperflexDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexDriveRelationship(p, d) @@ -2543,7 +2543,7 @@ func TestFlattenListHyperflexDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2552,7 +2552,7 @@ func TestFlattenListHyperflexDriveRelationship(t *testing.T) { func TestFlattenListHyperflexFeatureLimitEntry(t *testing.T) { p := []models.HyperflexFeatureLimitEntry{} var d = &schema.ResourceData{} - c := `{"Value":"Value %d","ClassId":"hyperflex.FeatureLimitEntry","ObjectType":"hyperflex.FeatureLimitEntry","Name":"Name %d"}` + c := `{"ObjectType":"hyperflex.FeatureLimitEntry","Name":"Name %d","Value":"Value %d","ClassId":"hyperflex.FeatureLimitEntry"}` //test when the response is empty ffOpEmpty := flattenListHyperflexFeatureLimitEntry(p, d) @@ -2567,7 +2567,7 @@ func TestFlattenListHyperflexFeatureLimitEntry(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexFeatureLimitEntry(p, d) - expectedOp := []map[string]interface{}{{"value": "Value 1", "class_id": "hyperflex.FeatureLimitEntry", "object_type": "hyperflex.FeatureLimitEntry", "name": "Name 1"}, {"value": "Value 2", "class_id": "hyperflex.FeatureLimitEntry", "object_type": "hyperflex.FeatureLimitEntry", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "hyperflex.FeatureLimitEntry", "name": "Name 1", "value": "Value 1", "class_id": "hyperflex.FeatureLimitEntry"}, {"object_type": "hyperflex.FeatureLimitEntry", "name": "Name 2", "value": "Value 2", "class_id": "hyperflex.FeatureLimitEntry"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2576,7 +2576,7 @@ func TestFlattenListHyperflexFeatureLimitEntry(t *testing.T) { func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { p := []models.HyperflexHealthCheckScriptInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HealthCheckScriptInfo","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptName":"ScriptName %d","Version":"Version %d","HyperflexVersion":"HyperflexVersion %d","ObjectType":"hyperflex.HealthCheckScriptInfo","ScriptInput":"ScriptInput %d","AggregateScriptName":"AggregateScriptName %d"}` + c := `{"ClassId":"hyperflex.HealthCheckScriptInfo","HyperflexVersion":"HyperflexVersion %d","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptInput":"ScriptInput %d","ScriptName":"ScriptName %d","Version":"Version %d","ObjectType":"hyperflex.HealthCheckScriptInfo","AggregateScriptName":"AggregateScriptName %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHealthCheckScriptInfo(p, d) @@ -2591,7 +2591,7 @@ func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHealthCheckScriptInfo(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HealthCheckScriptInfo", "script_execute_location": "ScriptExecuteLocation 1", "script_name": "ScriptName 1", "nr_version": "Version 1", "hyperflex_version": "HyperflexVersion 1", "object_type": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 1", "aggregate_script_name": "AggregateScriptName 1"}, {"class_id": "hyperflex.HealthCheckScriptInfo", "script_execute_location": "ScriptExecuteLocation 2", "script_name": "ScriptName 2", "nr_version": "Version 2", "hyperflex_version": "HyperflexVersion 2", "object_type": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 2", "aggregate_script_name": "AggregateScriptName 2"}} + expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HealthCheckScriptInfo", "hyperflex_version": "HyperflexVersion 1", "script_execute_location": "ScriptExecuteLocation 1", "script_input": "ScriptInput 1", "script_name": "ScriptName 1", "nr_version": "Version 1", "object_type": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 1"}, {"class_id": "hyperflex.HealthCheckScriptInfo", "hyperflex_version": "HyperflexVersion 2", "script_execute_location": "ScriptExecuteLocation 2", "script_input": "ScriptInput 2", "script_name": "ScriptName 2", "nr_version": "Version 2", "object_type": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2600,7 +2600,7 @@ func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { p := []models.HyperflexHxHostMountStatusDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxHostMountStatusDt","ObjectType":"hyperflex.HxHostMountStatusDt","Accessibility":"Accessibility %d","HostName":"HostName %d","Mounted":true,"Reason":"Reason %d"}` + c := `{"HostName":"HostName %d","Mounted":true,"Reason":"Reason %d","ClassId":"hyperflex.HxHostMountStatusDt","ObjectType":"hyperflex.HxHostMountStatusDt","Accessibility":"Accessibility %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxHostMountStatusDt(p, d) @@ -2615,7 +2615,7 @@ func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxHostMountStatusDt(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 1", "host_name": "HostName 1", "mounted": true, "reason": "Reason 1"}, {"class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 2", "host_name": "HostName 2", "mounted": true, "reason": "Reason 2"}} + expectedOp := []map[string]interface{}{{"host_name": "HostName 1", "mounted": true, "reason": "Reason 1", "class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 1"}, {"host_name": "HostName 2", "mounted": true, "reason": "Reason 2", "class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2624,7 +2624,7 @@ func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { p := []models.HyperflexHxZoneResiliencyInfoDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxZoneResiliencyInfoDt","ObjectType":"hyperflex.HxZoneResiliencyInfoDt","Name":"Name %d"}` + c := `{"ObjectType":"hyperflex.HxZoneResiliencyInfoDt","ClassId":"hyperflex.HxZoneResiliencyInfoDt","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxZoneResiliencyInfoDt(p, d) @@ -2639,7 +2639,7 @@ func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxZoneResiliencyInfoDt(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HxZoneResiliencyInfoDt", "object_type": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 1"}, {"class_id": "hyperflex.HxZoneResiliencyInfoDt", "object_type": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "hyperflex.HxZoneResiliencyInfoDt", "class_id": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 1"}, {"object_type": "hyperflex.HxZoneResiliencyInfoDt", "class_id": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2648,7 +2648,7 @@ func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { func TestFlattenListHyperflexHxapHostRelationship(t *testing.T) { p := []models.HyperflexHxapHostRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxapHostRelationship(p, d) @@ -2663,7 +2663,7 @@ func TestFlattenListHyperflexHxapHostRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxapHostRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2672,7 +2672,7 @@ func TestFlattenListHyperflexHxapHostRelationship(t *testing.T) { func TestFlattenListHyperflexHxapHostInterfaceRelationship(t *testing.T) { p := []models.HyperflexHxapHostInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxapHostInterfaceRelationship(p, d) @@ -2687,7 +2687,7 @@ func TestFlattenListHyperflexHxapHostInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxapHostInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2696,7 +2696,7 @@ func TestFlattenListHyperflexHxapHostInterfaceRelationship(t *testing.T) { func TestFlattenListHyperflexHxapHostVswitchRelationship(t *testing.T) { p := []models.HyperflexHxapHostVswitchRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxapHostVswitchRelationship(p, d) @@ -2711,7 +2711,7 @@ func TestFlattenListHyperflexHxapHostVswitchRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxapHostVswitchRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2720,7 +2720,7 @@ func TestFlattenListHyperflexHxapHostVswitchRelationship(t *testing.T) { func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { p := []models.HyperflexHxdpVersionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxdpVersionRelationship(p, d) @@ -2735,7 +2735,7 @@ func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxdpVersionRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2744,7 +2744,7 @@ func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { func TestFlattenListHyperflexIpAddrRange(t *testing.T) { p := []models.HyperflexIpAddrRange{} var d = &schema.ResourceData{} - c := `{"StartAddr":"StartAddr %d","EndAddr":"EndAddr %d","Gateway":"Gateway %d","ClassId":"hyperflex.IpAddrRange","ObjectType":"hyperflex.IpAddrRange","Netmask":"Netmask %d"}` + c := `{"Netmask":"Netmask %d","StartAddr":"StartAddr %d","ClassId":"hyperflex.IpAddrRange","ObjectType":"hyperflex.IpAddrRange","EndAddr":"EndAddr %d","Gateway":"Gateway %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexIpAddrRange(p, d) @@ -2759,7 +2759,7 @@ func TestFlattenListHyperflexIpAddrRange(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexIpAddrRange(p, d) - expectedOp := []map[string]interface{}{{"start_addr": "StartAddr 1", "end_addr": "EndAddr 1", "gateway": "Gateway 1", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "netmask": "Netmask 1"}, {"start_addr": "StartAddr 2", "end_addr": "EndAddr 2", "gateway": "Gateway 2", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "netmask": "Netmask 2"}} + expectedOp := []map[string]interface{}{{"netmask": "Netmask 1", "start_addr": "StartAddr 1", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "end_addr": "EndAddr 1", "gateway": "Gateway 1"}, {"netmask": "Netmask 2", "start_addr": "StartAddr 2", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "end_addr": "EndAddr 2", "gateway": "Gateway 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2792,7 +2792,7 @@ func TestFlattenListHyperflexMapClusterIdToProtectionInfo(t *testing.T) { func TestFlattenListHyperflexMapClusterIdToStSnapshotPoint(t *testing.T) { p := []models.HyperflexMapClusterIdToStSnapshotPoint{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.MapClusterIdToStSnapshotPoint","ObjectType":"hyperflex.MapClusterIdToStSnapshotPoint","ClusterId":"ClusterId %d"}` + c := `{"ClusterId":"ClusterId %d","ClassId":"hyperflex.MapClusterIdToStSnapshotPoint","ObjectType":"hyperflex.MapClusterIdToStSnapshotPoint"}` //test when the response is empty ffOpEmpty := flattenListHyperflexMapClusterIdToStSnapshotPoint(p, d) @@ -2807,7 +2807,7 @@ func TestFlattenListHyperflexMapClusterIdToStSnapshotPoint(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexMapClusterIdToStSnapshotPoint(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.MapClusterIdToStSnapshotPoint", "object_type": "hyperflex.MapClusterIdToStSnapshotPoint", "cluster_id": "ClusterId 1"}, {"class_id": "hyperflex.MapClusterIdToStSnapshotPoint", "object_type": "hyperflex.MapClusterIdToStSnapshotPoint", "cluster_id": "ClusterId 2"}} + expectedOp := []map[string]interface{}{{"cluster_id": "ClusterId 1", "class_id": "hyperflex.MapClusterIdToStSnapshotPoint", "object_type": "hyperflex.MapClusterIdToStSnapshotPoint"}, {"cluster_id": "ClusterId 2", "class_id": "hyperflex.MapClusterIdToStSnapshotPoint", "object_type": "hyperflex.MapClusterIdToStSnapshotPoint"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2816,7 +2816,7 @@ func TestFlattenListHyperflexMapClusterIdToStSnapshotPoint(t *testing.T) { func TestFlattenListHyperflexNamedVlan(t *testing.T) { p := []models.HyperflexNamedVlan{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.NamedVlan","ObjectType":"hyperflex.NamedVlan","Name":"Name %d","VlanId":32}` + c := `{"Name":"Name %d","VlanId":32,"ClassId":"hyperflex.NamedVlan","ObjectType":"hyperflex.NamedVlan"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNamedVlan(p, d) @@ -2831,7 +2831,7 @@ func TestFlattenListHyperflexNamedVlan(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNamedVlan(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan", "name": "Name 1", "vlan_id": 32}, {"class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan", "name": "Name 2", "vlan_id": 32}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "vlan_id": 32, "class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan"}, {"name": "Name 2", "vlan_id": 32, "class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2840,7 +2840,7 @@ func TestFlattenListHyperflexNamedVlan(t *testing.T) { func TestFlattenListHyperflexNetworkPort(t *testing.T) { p := []models.HyperflexNetworkPort{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.NetworkPort","ObjectType":"hyperflex.NetworkPort","PortType":"PortType %d","Vlans":"Vlans %d","Name":"Name %d"}` + c := `{"ObjectType":"hyperflex.NetworkPort","ClassId":"hyperflex.NetworkPort","Name":"Name %d","PortType":"PortType %d","Vlans":"Vlans %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNetworkPort(p, d) @@ -2855,7 +2855,7 @@ func TestFlattenListHyperflexNetworkPort(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNetworkPort(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.NetworkPort", "object_type": "hyperflex.NetworkPort", "port_type": "PortType 1", "vlans": "Vlans 1", "name": "Name 1"}, {"class_id": "hyperflex.NetworkPort", "object_type": "hyperflex.NetworkPort", "port_type": "PortType 2", "vlans": "Vlans 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "hyperflex.NetworkPort", "class_id": "hyperflex.NetworkPort", "name": "Name 1", "port_type": "PortType 1", "vlans": "Vlans 1"}, {"object_type": "hyperflex.NetworkPort", "class_id": "hyperflex.NetworkPort", "name": "Name 2", "port_type": "PortType 2", "vlans": "Vlans 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2864,7 +2864,7 @@ func TestFlattenListHyperflexNetworkPort(t *testing.T) { func TestFlattenListHyperflexNodeRelationship(t *testing.T) { p := []models.HyperflexNodeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNodeRelationship(p, d) @@ -2879,7 +2879,7 @@ func TestFlattenListHyperflexNodeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNodeRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2888,7 +2888,7 @@ func TestFlattenListHyperflexNodeRelationship(t *testing.T) { func TestFlattenListHyperflexNodeProfileRelationship(t *testing.T) { p := []models.HyperflexNodeProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNodeProfileRelationship(p, d) @@ -2903,7 +2903,7 @@ func TestFlattenListHyperflexNodeProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNodeProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2936,7 +2936,7 @@ func TestFlattenListHyperflexReplicationClusterReferenceToSchedule(t *testing.T) func TestFlattenListHyperflexServerFirmwareVersionEntryRelationship(t *testing.T) { p := []models.HyperflexServerFirmwareVersionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexServerFirmwareVersionEntryRelationship(p, d) @@ -2951,7 +2951,7 @@ func TestFlattenListHyperflexServerFirmwareVersionEntryRelationship(t *testing.T p = append(p, x) } ffOp := flattenListHyperflexServerFirmwareVersionEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2984,7 +2984,7 @@ func TestFlattenListHyperflexServerFirmwareVersionInfo(t *testing.T) { func TestFlattenListHyperflexServerModelEntry(t *testing.T) { p := []models.HyperflexServerModelEntry{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.ServerModelEntry","ObjectType":"hyperflex.ServerModelEntry","Name":"Name %d","Value":"Value %d"}` + c := `{"Name":"Name %d","Value":"Value %d","ClassId":"hyperflex.ServerModelEntry","ObjectType":"hyperflex.ServerModelEntry"}` //test when the response is empty ffOpEmpty := flattenListHyperflexServerModelEntry(p, d) @@ -2999,7 +2999,7 @@ func TestFlattenListHyperflexServerModelEntry(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexServerModelEntry(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.ServerModelEntry", "object_type": "hyperflex.ServerModelEntry", "name": "Name 1", "value": "Value 1"}, {"class_id": "hyperflex.ServerModelEntry", "object_type": "hyperflex.ServerModelEntry", "name": "Name 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "value": "Value 1", "class_id": "hyperflex.ServerModelEntry", "object_type": "hyperflex.ServerModelEntry"}, {"name": "Name 2", "value": "Value 2", "class_id": "hyperflex.ServerModelEntry", "object_type": "hyperflex.ServerModelEntry"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3008,7 +3008,7 @@ func TestFlattenListHyperflexServerModelEntry(t *testing.T) { func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testing.T) { p := []models.HyperflexSoftwareDistributionComponentRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexSoftwareDistributionComponentRelationship(p, d) @@ -3023,7 +3023,7 @@ func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testin p = append(p, x) } ffOp := flattenListHyperflexSoftwareDistributionComponentRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3032,7 +3032,7 @@ func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testin func TestFlattenListHyperflexSoftwareDistributionEntryRelationship(t *testing.T) { p := []models.HyperflexSoftwareDistributionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexSoftwareDistributionEntryRelationship(p, d) @@ -3047,7 +3047,7 @@ func TestFlattenListHyperflexSoftwareDistributionEntryRelationship(t *testing.T) p = append(p, x) } ffOp := flattenListHyperflexSoftwareDistributionEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3056,7 +3056,7 @@ func TestFlattenListHyperflexSoftwareDistributionEntryRelationship(t *testing.T) func TestFlattenListHyperflexSoftwareDistributionVersionRelationship(t *testing.T) { p := []models.HyperflexSoftwareDistributionVersionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexSoftwareDistributionVersionRelationship(p, d) @@ -3071,7 +3071,7 @@ func TestFlattenListHyperflexSoftwareDistributionVersionRelationship(t *testing. p = append(p, x) } ffOp := flattenListHyperflexSoftwareDistributionVersionRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3080,7 +3080,7 @@ func TestFlattenListHyperflexSoftwareDistributionVersionRelationship(t *testing. func TestFlattenListHyperflexVmDisk(t *testing.T) { p := []models.HyperflexVmDisk{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.VmDisk","ObjectType":"hyperflex.VmDisk","Bus":"Bus %d","Type":"Type %d","VirtualDiskReference":"VirtualDiskReference %d","BootOrder":32,"Name":"Name %d"}` + c := `{"Bus":"Bus %d","Name":"Name %d","Type":"Type %d","VirtualDiskReference":"VirtualDiskReference %d","BootOrder":32,"ClassId":"hyperflex.VmDisk","ObjectType":"hyperflex.VmDisk"}` //test when the response is empty ffOpEmpty := flattenListHyperflexVmDisk(p, d) @@ -3095,7 +3095,7 @@ func TestFlattenListHyperflexVmDisk(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexVmDisk(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.VmDisk", "object_type": "hyperflex.VmDisk", "bus": "Bus 1", "type": "Type 1", "virtual_disk_reference": "VirtualDiskReference 1", "boot_order": 32, "name": "Name 1"}, {"class_id": "hyperflex.VmDisk", "object_type": "hyperflex.VmDisk", "bus": "Bus 2", "type": "Type 2", "virtual_disk_reference": "VirtualDiskReference 2", "boot_order": 32, "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"bus": "Bus 1", "name": "Name 1", "type": "Type 1", "virtual_disk_reference": "VirtualDiskReference 1", "boot_order": 32, "class_id": "hyperflex.VmDisk", "object_type": "hyperflex.VmDisk"}, {"bus": "Bus 2", "name": "Name 2", "type": "Type 2", "virtual_disk_reference": "VirtualDiskReference 2", "boot_order": 32, "class_id": "hyperflex.VmDisk", "object_type": "hyperflex.VmDisk"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3104,7 +3104,7 @@ func TestFlattenListHyperflexVmDisk(t *testing.T) { func TestFlattenListHyperflexVmInterface(t *testing.T) { p := []models.HyperflexVmInterface{} var d = &schema.ResourceData{} - c := `{"Model":"Model %d","Name":"Name %d","Bridge":"Bridge %d","ClassId":"hyperflex.VmInterface","ObjectType":"hyperflex.VmInterface","MacAddress":"MacAddress %d"}` + c := `{"MacAddress":"MacAddress %d","Model":"Model %d","Name":"Name %d","ClassId":"hyperflex.VmInterface","ObjectType":"hyperflex.VmInterface","Bridge":"Bridge %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexVmInterface(p, d) @@ -3119,7 +3119,7 @@ func TestFlattenListHyperflexVmInterface(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexVmInterface(p, d) - expectedOp := []map[string]interface{}{{"model": "Model 1", "name": "Name 1", "bridge": "Bridge 1", "class_id": "hyperflex.VmInterface", "object_type": "hyperflex.VmInterface", "mac_address": "MacAddress 1"}, {"model": "Model 2", "name": "Name 2", "bridge": "Bridge 2", "class_id": "hyperflex.VmInterface", "object_type": "hyperflex.VmInterface", "mac_address": "MacAddress 2"}} + expectedOp := []map[string]interface{}{{"mac_address": "MacAddress 1", "model": "Model 1", "name": "Name 1", "class_id": "hyperflex.VmInterface", "object_type": "hyperflex.VmInterface", "bridge": "Bridge 1"}, {"mac_address": "MacAddress 2", "model": "Model 2", "name": "Name 2", "class_id": "hyperflex.VmInterface", "object_type": "hyperflex.VmInterface", "bridge": "Bridge 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3128,7 +3128,7 @@ func TestFlattenListHyperflexVmInterface(t *testing.T) { func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { p := []models.HyperflexVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexVolumeRelationship(p, d) @@ -3143,7 +3143,7 @@ func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3152,7 +3152,7 @@ func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { func TestFlattenListIaasConnectorPackRelationship(t *testing.T) { p := []models.IaasConnectorPackRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIaasConnectorPackRelationship(p, d) @@ -3167,7 +3167,7 @@ func TestFlattenListIaasConnectorPackRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasConnectorPackRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3200,7 +3200,7 @@ func TestFlattenListIaasDeviceStatusRelationship(t *testing.T) { func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { p := []models.IaasLicenseKeysInfo{} var d = &schema.ResourceData{} - c := `{"Pid":"Pid %d","Count":32,"ExpirationDate":"ExpirationDate %d","LicenseId":"LicenseId %d","ClassId":"iaas.LicenseKeysInfo","ObjectType":"iaas.LicenseKeysInfo"}` + c := `{"LicenseId":"LicenseId %d","Pid":"Pid %d","Count":32,"ClassId":"iaas.LicenseKeysInfo","ObjectType":"iaas.LicenseKeysInfo","ExpirationDate":"ExpirationDate %d"}` //test when the response is empty ffOpEmpty := flattenListIaasLicenseKeysInfo(p, d) @@ -3215,7 +3215,7 @@ func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasLicenseKeysInfo(p, d) - expectedOp := []map[string]interface{}{{"pid": "Pid 1", "nr_count": 32, "expiration_date": "ExpirationDate 1", "license_id": "LicenseId 1", "class_id": "iaas.LicenseKeysInfo", "object_type": "iaas.LicenseKeysInfo"}, {"pid": "Pid 2", "nr_count": 32, "expiration_date": "ExpirationDate 2", "license_id": "LicenseId 2", "class_id": "iaas.LicenseKeysInfo", "object_type": "iaas.LicenseKeysInfo"}} + expectedOp := []map[string]interface{}{{"license_id": "LicenseId 1", "pid": "Pid 1", "nr_count": 32, "class_id": "iaas.LicenseKeysInfo", "object_type": "iaas.LicenseKeysInfo", "expiration_date": "ExpirationDate 1"}, {"license_id": "LicenseId 2", "pid": "Pid 2", "nr_count": 32, "class_id": "iaas.LicenseKeysInfo", "object_type": "iaas.LicenseKeysInfo", "expiration_date": "ExpirationDate 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3224,7 +3224,7 @@ func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { func TestFlattenListIaasLicenseUtilizationInfo(t *testing.T) { p := []models.IaasLicenseUtilizationInfo{} var d = &schema.ResourceData{} - c := `{"Label":"Label %d","LicensedLimit":"LicensedLimit %d","Sku":"Sku %d","ClassId":"iaas.LicenseUtilizationInfo","ObjectType":"iaas.LicenseUtilizationInfo","ActualUsed":32}` + c := `{"Label":"Label %d","LicensedLimit":"LicensedLimit %d","Sku":"Sku %d","ObjectType":"iaas.LicenseUtilizationInfo","ClassId":"iaas.LicenseUtilizationInfo","ActualUsed":32}` //test when the response is empty ffOpEmpty := flattenListIaasLicenseUtilizationInfo(p, d) @@ -3239,7 +3239,7 @@ func TestFlattenListIaasLicenseUtilizationInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasLicenseUtilizationInfo(p, d) - expectedOp := []map[string]interface{}{{"label": "Label 1", "licensed_limit": "LicensedLimit 1", "sku": "Sku 1", "class_id": "iaas.LicenseUtilizationInfo", "object_type": "iaas.LicenseUtilizationInfo", "actual_used": 32}, {"label": "Label 2", "licensed_limit": "LicensedLimit 2", "sku": "Sku 2", "class_id": "iaas.LicenseUtilizationInfo", "object_type": "iaas.LicenseUtilizationInfo", "actual_used": 32}} + expectedOp := []map[string]interface{}{{"label": "Label 1", "licensed_limit": "LicensedLimit 1", "sku": "Sku 1", "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo", "actual_used": 32}, {"label": "Label 2", "licensed_limit": "LicensedLimit 2", "sku": "Sku 2", "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo", "actual_used": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3248,7 +3248,7 @@ func TestFlattenListIaasLicenseUtilizationInfo(t *testing.T) { func TestFlattenListIaasMostRunTasksRelationship(t *testing.T) { p := []models.IaasMostRunTasksRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIaasMostRunTasksRelationship(p, d) @@ -3263,7 +3263,7 @@ func TestFlattenListIaasMostRunTasksRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasMostRunTasksRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3272,7 +3272,7 @@ func TestFlattenListIaasMostRunTasksRelationship(t *testing.T) { func TestFlattenListIaasWorkflowSteps(t *testing.T) { p := []models.IaasWorkflowSteps{} var d = &schema.ResourceData{} - c := `{"ClassId":"iaas.WorkflowSteps","ObjectType":"iaas.WorkflowSteps","Status":"Status %d","StatusMessage":"StatusMessage %d","CompletedTime":"CompletedTime %d","Name":"Name %d"}` + c := `{"Name":"Name %d","Status":"Status %d","StatusMessage":"StatusMessage %d","ObjectType":"iaas.WorkflowSteps","ClassId":"iaas.WorkflowSteps","CompletedTime":"CompletedTime %d"}` //test when the response is empty ffOpEmpty := flattenListIaasWorkflowSteps(p, d) @@ -3287,7 +3287,7 @@ func TestFlattenListIaasWorkflowSteps(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasWorkflowSteps(p, d) - expectedOp := []map[string]interface{}{{"class_id": "iaas.WorkflowSteps", "object_type": "iaas.WorkflowSteps", "status": "Status 1", "status_message": "StatusMessage 1", "completed_time": "CompletedTime 1", "name": "Name 1"}, {"class_id": "iaas.WorkflowSteps", "object_type": "iaas.WorkflowSteps", "status": "Status 2", "status_message": "StatusMessage 2", "completed_time": "CompletedTime 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "status": "Status 1", "status_message": "StatusMessage 1", "object_type": "iaas.WorkflowSteps", "class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 1"}, {"name": "Name 2", "status": "Status 2", "status_message": "StatusMessage 2", "object_type": "iaas.WorkflowSteps", "class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3296,7 +3296,7 @@ func TestFlattenListIaasWorkflowSteps(t *testing.T) { func TestFlattenListIamAccountPermissions(t *testing.T) { p := []models.IamAccountPermissions{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.AccountPermissions","ObjectType":"iam.AccountPermissions","AccountIdentifier":"AccountIdentifier %d","AccountName":"AccountName %d","AccountStatus":"AccountStatus %d"}` + c := `{"AccountStatus":"AccountStatus %d","ClassId":"iam.AccountPermissions","ObjectType":"iam.AccountPermissions","AccountIdentifier":"AccountIdentifier %d","AccountName":"AccountName %d"}` //test when the response is empty ffOpEmpty := flattenListIamAccountPermissions(p, d) @@ -3311,7 +3311,7 @@ func TestFlattenListIamAccountPermissions(t *testing.T) { p = append(p, x) } ffOp := flattenListIamAccountPermissions(p, d) - expectedOp := []map[string]interface{}{{"class_id": "iam.AccountPermissions", "object_type": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 1", "account_name": "AccountName 1", "account_status": "AccountStatus 1"}, {"class_id": "iam.AccountPermissions", "object_type": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 2", "account_name": "AccountName 2", "account_status": "AccountStatus 2"}} + expectedOp := []map[string]interface{}{{"account_status": "AccountStatus 1", "class_id": "iam.AccountPermissions", "object_type": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 1", "account_name": "AccountName 1"}, {"account_status": "AccountStatus 2", "class_id": "iam.AccountPermissions", "object_type": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 2", "account_name": "AccountName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3320,7 +3320,7 @@ func TestFlattenListIamAccountPermissions(t *testing.T) { func TestFlattenListIamApiKeyRelationship(t *testing.T) { p := []models.IamApiKeyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamApiKeyRelationship(p, d) @@ -3335,7 +3335,7 @@ func TestFlattenListIamApiKeyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamApiKeyRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3344,7 +3344,7 @@ func TestFlattenListIamApiKeyRelationship(t *testing.T) { func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { p := []models.IamAppRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamAppRegistrationRelationship(p, d) @@ -3359,7 +3359,7 @@ func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamAppRegistrationRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3368,7 +3368,7 @@ func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { func TestFlattenListIamDomainGroupRelationship(t *testing.T) { p := []models.IamDomainGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamDomainGroupRelationship(p, d) @@ -3383,7 +3383,7 @@ func TestFlattenListIamDomainGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamDomainGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3392,7 +3392,7 @@ func TestFlattenListIamDomainGroupRelationship(t *testing.T) { func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { p := []models.IamEndPointPrivilegeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamEndPointPrivilegeRelationship(p, d) @@ -3407,7 +3407,7 @@ func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamEndPointPrivilegeRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3416,7 +3416,7 @@ func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { func TestFlattenListIamEndPointRoleRelationship(t *testing.T) { p := []models.IamEndPointRoleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamEndPointRoleRelationship(p, d) @@ -3431,7 +3431,7 @@ func TestFlattenListIamEndPointRoleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamEndPointRoleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3440,7 +3440,7 @@ func TestFlattenListIamEndPointRoleRelationship(t *testing.T) { func TestFlattenListIamEndPointUserRoleRelationship(t *testing.T) { p := []models.IamEndPointUserRoleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamEndPointUserRoleRelationship(p, d) @@ -3455,7 +3455,7 @@ func TestFlattenListIamEndPointUserRoleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamEndPointUserRoleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3488,7 +3488,7 @@ func TestFlattenListIamFeatureDefinition(t *testing.T) { func TestFlattenListIamGroupPermissionToRoles(t *testing.T) { p := []models.IamGroupPermissionToRoles{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.GroupPermissionToRoles","ObjectType":"iam.GroupPermissionToRoles"}` + c := `{"ObjectType":"iam.GroupPermissionToRoles","ClassId":"iam.GroupPermissionToRoles"}` //test when the response is empty ffOpEmpty := flattenListIamGroupPermissionToRoles(p, d) @@ -3503,7 +3503,7 @@ func TestFlattenListIamGroupPermissionToRoles(t *testing.T) { p = append(p, x) } ffOp := flattenListIamGroupPermissionToRoles(p, d) - expectedOp := []map[string]interface{}{{"class_id": "iam.GroupPermissionToRoles", "object_type": "iam.GroupPermissionToRoles"}, {"class_id": "iam.GroupPermissionToRoles", "object_type": "iam.GroupPermissionToRoles"}} + expectedOp := []map[string]interface{}{{"object_type": "iam.GroupPermissionToRoles", "class_id": "iam.GroupPermissionToRoles"}, {"object_type": "iam.GroupPermissionToRoles", "class_id": "iam.GroupPermissionToRoles"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3512,7 +3512,7 @@ func TestFlattenListIamGroupPermissionToRoles(t *testing.T) { func TestFlattenListIamIdpRelationship(t *testing.T) { p := []models.IamIdpRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamIdpRelationship(p, d) @@ -3527,7 +3527,7 @@ func TestFlattenListIamIdpRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIdpRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3536,7 +3536,7 @@ func TestFlattenListIamIdpRelationship(t *testing.T) { func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { p := []models.IamIdpReferenceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamIdpReferenceRelationship(p, d) @@ -3551,7 +3551,7 @@ func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIdpReferenceRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3560,7 +3560,7 @@ func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { func TestFlattenListIamIpAddressRelationship(t *testing.T) { p := []models.IamIpAddressRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamIpAddressRelationship(p, d) @@ -3575,7 +3575,7 @@ func TestFlattenListIamIpAddressRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIpAddressRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3632,7 +3632,7 @@ func TestFlattenListIamLdapProviderRelationship(t *testing.T) { func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { p := []models.IamOAuthTokenRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamOAuthTokenRelationship(p, d) @@ -3647,7 +3647,7 @@ func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamOAuthTokenRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3656,7 +3656,7 @@ func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { func TestFlattenListIamPermissionRelationship(t *testing.T) { p := []models.IamPermissionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamPermissionRelationship(p, d) @@ -3671,7 +3671,7 @@ func TestFlattenListIamPermissionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPermissionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3704,7 +3704,7 @@ func TestFlattenListIamPermissionToRoles(t *testing.T) { func TestFlattenListIamPrivilegeRelationship(t *testing.T) { p := []models.IamPrivilegeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamPrivilegeRelationship(p, d) @@ -3719,7 +3719,7 @@ func TestFlattenListIamPrivilegeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPrivilegeRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3728,7 +3728,7 @@ func TestFlattenListIamPrivilegeRelationship(t *testing.T) { func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { p := []models.IamPrivilegeSetRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamPrivilegeSetRelationship(p, d) @@ -3743,7 +3743,7 @@ func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPrivilegeSetRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3752,7 +3752,7 @@ func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { func TestFlattenListIamResourcePermissionRelationship(t *testing.T) { p := []models.IamResourcePermissionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamResourcePermissionRelationship(p, d) @@ -3767,7 +3767,7 @@ func TestFlattenListIamResourcePermissionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamResourcePermissionRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3800,7 +3800,7 @@ func TestFlattenListIamResourceRolesRelationship(t *testing.T) { func TestFlattenListIamRoleRelationship(t *testing.T) { p := []models.IamRoleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamRoleRelationship(p, d) @@ -3815,7 +3815,7 @@ func TestFlattenListIamRoleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamRoleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3824,7 +3824,7 @@ func TestFlattenListIamRoleRelationship(t *testing.T) { func TestFlattenListIamSessionRelationship(t *testing.T) { p := []models.IamSessionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamSessionRelationship(p, d) @@ -3839,7 +3839,7 @@ func TestFlattenListIamSessionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamSessionRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3848,7 +3848,7 @@ func TestFlattenListIamSessionRelationship(t *testing.T) { func TestFlattenListIamUserRelationship(t *testing.T) { p := []models.IamUserRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamUserRelationship(p, d) @@ -3863,7 +3863,7 @@ func TestFlattenListIamUserRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamUserRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3872,7 +3872,7 @@ func TestFlattenListIamUserRelationship(t *testing.T) { func TestFlattenListIamUserGroupRelationship(t *testing.T) { p := []models.IamUserGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamUserGroupRelationship(p, d) @@ -3887,7 +3887,7 @@ func TestFlattenListIamUserGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamUserGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3896,7 +3896,7 @@ func TestFlattenListIamUserGroupRelationship(t *testing.T) { func TestFlattenListIamUserPreferenceRelationship(t *testing.T) { p := []models.IamUserPreferenceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamUserPreferenceRelationship(p, d) @@ -3911,7 +3911,7 @@ func TestFlattenListIamUserPreferenceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamUserPreferenceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3920,7 +3920,7 @@ func TestFlattenListIamUserPreferenceRelationship(t *testing.T) { func TestFlattenListInfraMetaData(t *testing.T) { p := []models.InfraMetaData{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Value":"Value %d","ClassId":"infra.MetaData","ObjectType":"infra.MetaData"}` + c := `{"ObjectType":"infra.MetaData","ClassId":"infra.MetaData","Name":"Name %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListInfraMetaData(p, d) @@ -3935,7 +3935,7 @@ func TestFlattenListInfraMetaData(t *testing.T) { p = append(p, x) } ffOp := flattenListInfraMetaData(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "value": "Value 1", "class_id": "infra.MetaData", "object_type": "infra.MetaData"}, {"name": "Name 2", "value": "Value 2", "class_id": "infra.MetaData", "object_type": "infra.MetaData"}} + expectedOp := []map[string]interface{}{{"object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 1", "value": "Value 1"}, {"object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3968,7 +3968,7 @@ func TestFlattenListInventoryGenericInventoryRelationship(t *testing.T) { func TestFlattenListInventoryGenericInventoryHolderRelationship(t *testing.T) { p := []models.InventoryGenericInventoryHolderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListInventoryGenericInventoryHolderRelationship(p, d) @@ -3983,7 +3983,7 @@ func TestFlattenListInventoryGenericInventoryHolderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListInventoryGenericInventoryHolderRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3992,7 +3992,7 @@ func TestFlattenListInventoryGenericInventoryHolderRelationship(t *testing.T) { func TestFlattenListIppoolIpLeaseRelationship(t *testing.T) { p := []models.IppoolIpLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolIpLeaseRelationship(p, d) @@ -4007,7 +4007,7 @@ func TestFlattenListIppoolIpLeaseRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolIpLeaseRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4016,7 +4016,7 @@ func TestFlattenListIppoolIpLeaseRelationship(t *testing.T) { func TestFlattenListIppoolIpV4Block(t *testing.T) { p := []models.IppoolIpV4Block{} var d = &schema.ResourceData{} - c := `{"Size":32,"To":"To %d","From":"From %d","ClassId":"ippool.IpV4Block","ObjectType":"ippool.IpV4Block"}` + c := `{"ClassId":"ippool.IpV4Block","ObjectType":"ippool.IpV4Block","Size":32,"From":"From %d","To":"To %d"}` //test when the response is empty ffOpEmpty := flattenListIppoolIpV4Block(p, d) @@ -4031,7 +4031,7 @@ func TestFlattenListIppoolIpV4Block(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolIpV4Block(p, d) - expectedOp := []map[string]interface{}{{"size": 32, "to": "To 1", "from": "From 1", "class_id": "ippool.IpV4Block", "object_type": "ippool.IpV4Block"}, {"size": 32, "to": "To 2", "from": "From 2", "class_id": "ippool.IpV4Block", "object_type": "ippool.IpV4Block"}} + expectedOp := []map[string]interface{}{{"class_id": "ippool.IpV4Block", "object_type": "ippool.IpV4Block", "size": 32, "from": "From 1", "to": "To 1"}, {"class_id": "ippool.IpV4Block", "object_type": "ippool.IpV4Block", "size": 32, "from": "From 2", "to": "To 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4088,7 +4088,7 @@ func TestFlattenListIppoolPoolRelationship(t *testing.T) { func TestFlattenListIppoolShadowBlockRelationship(t *testing.T) { p := []models.IppoolShadowBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolShadowBlockRelationship(p, d) @@ -4103,7 +4103,7 @@ func TestFlattenListIppoolShadowBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolShadowBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4112,7 +4112,7 @@ func TestFlattenListIppoolShadowBlockRelationship(t *testing.T) { func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { p := []models.IppoolShadowPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolShadowPoolRelationship(p, d) @@ -4127,7 +4127,7 @@ func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolShadowPoolRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4136,7 +4136,7 @@ func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { p := []models.IqnpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIqnpoolBlockRelationship(p, d) @@ -4151,7 +4151,7 @@ func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIqnpoolBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4160,7 +4160,7 @@ func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { func TestFlattenListIqnpoolIqnSuffixBlock(t *testing.T) { p := []models.IqnpoolIqnSuffixBlock{} var d = &schema.ResourceData{} - c := `{"ObjectType":"iqnpool.IqnSuffixBlock","Size":32,"From":32,"Suffix":"Suffix %d","To":32,"ClassId":"iqnpool.IqnSuffixBlock"}` + c := `{"Suffix":"Suffix %d","ObjectType":"iqnpool.IqnSuffixBlock","Size":32,"ClassId":"iqnpool.IqnSuffixBlock","To":32,"From":32}` //test when the response is empty ffOpEmpty := flattenListIqnpoolIqnSuffixBlock(p, d) @@ -4175,7 +4175,7 @@ func TestFlattenListIqnpoolIqnSuffixBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListIqnpoolIqnSuffixBlock(p, d) - expectedOp := []map[string]interface{}{{"object_type": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 1", "to": 32, "class_id": "iqnpool.IqnSuffixBlock"}, {"object_type": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 2", "to": 32, "class_id": "iqnpool.IqnSuffixBlock"}} + expectedOp := []map[string]interface{}{{"suffix": "Suffix 1", "object_type": "iqnpool.IqnSuffixBlock", "size": 32, "class_id": "iqnpool.IqnSuffixBlock", "to": 32, "from": 32}, {"suffix": "Suffix 2", "object_type": "iqnpool.IqnSuffixBlock", "size": 32, "class_id": "iqnpool.IqnSuffixBlock", "to": 32, "from": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4184,7 +4184,7 @@ func TestFlattenListIqnpoolIqnSuffixBlock(t *testing.T) { func TestFlattenListKubernetesAciCniProfileRelationship(t *testing.T) { p := []models.KubernetesAciCniProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesAciCniProfileRelationship(p, d) @@ -4199,7 +4199,7 @@ func TestFlattenListKubernetesAciCniProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesAciCniProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4208,7 +4208,7 @@ func TestFlattenListKubernetesAciCniProfileRelationship(t *testing.T) { func TestFlattenListKubernetesAciCniTenantClusterAllocationRelationship(t *testing.T) { p := []models.KubernetesAciCniTenantClusterAllocationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListKubernetesAciCniTenantClusterAllocationRelationship(p, d) @@ -4223,7 +4223,7 @@ func TestFlattenListKubernetesAciCniTenantClusterAllocationRelationship(t *testi p = append(p, x) } ffOp := flattenListKubernetesAciCniTenantClusterAllocationRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4232,7 +4232,7 @@ func TestFlattenListKubernetesAciCniTenantClusterAllocationRelationship(t *testi func TestFlattenListKubernetesAddon(t *testing.T) { p := []models.KubernetesAddon{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ClassId":"kubernetes.Addon","ObjectType":"kubernetes.Addon"}` + c := `{"ClassId":"kubernetes.Addon","Name":"Name %d","ObjectType":"kubernetes.Addon"}` //test when the response is empty ffOpEmpty := flattenListKubernetesAddon(p, d) @@ -4247,7 +4247,7 @@ func TestFlattenListKubernetesAddon(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesAddon(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "class_id": "kubernetes.Addon", "object_type": "kubernetes.Addon"}, {"name": "Name 2", "class_id": "kubernetes.Addon", "object_type": "kubernetes.Addon"}} + expectedOp := []map[string]interface{}{{"class_id": "kubernetes.Addon", "name": "Name 1", "object_type": "kubernetes.Addon"}, {"class_id": "kubernetes.Addon", "name": "Name 2", "object_type": "kubernetes.Addon"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4304,7 +4304,7 @@ func TestFlattenListKubernetesConfigResultEntryRelationship(t *testing.T) { func TestFlattenListKubernetesEssentialAddon(t *testing.T) { p := []models.KubernetesEssentialAddon{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ClassId":"kubernetes.EssentialAddon","ObjectType":"kubernetes.EssentialAddon"}` + c := `{"ObjectType":"kubernetes.EssentialAddon","Name":"Name %d","ClassId":"kubernetes.EssentialAddon"}` //test when the response is empty ffOpEmpty := flattenListKubernetesEssentialAddon(p, d) @@ -4319,7 +4319,7 @@ func TestFlattenListKubernetesEssentialAddon(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesEssentialAddon(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "class_id": "kubernetes.EssentialAddon", "object_type": "kubernetes.EssentialAddon"}, {"name": "Name 2", "class_id": "kubernetes.EssentialAddon", "object_type": "kubernetes.EssentialAddon"}} + expectedOp := []map[string]interface{}{{"object_type": "kubernetes.EssentialAddon", "name": "Name 1", "class_id": "kubernetes.EssentialAddon"}, {"object_type": "kubernetes.EssentialAddon", "name": "Name 2", "class_id": "kubernetes.EssentialAddon"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4328,7 +4328,7 @@ func TestFlattenListKubernetesEssentialAddon(t *testing.T) { func TestFlattenListKubernetesNodeAddress(t *testing.T) { p := []models.KubernetesNodeAddress{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.NodeAddress","ObjectType":"kubernetes.NodeAddress","Address":"Address %d","Type":"Type %d"}` + c := `{"Address":"Address %d","Type":"Type %d","ObjectType":"kubernetes.NodeAddress","ClassId":"kubernetes.NodeAddress"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeAddress(p, d) @@ -4343,7 +4343,7 @@ func TestFlattenListKubernetesNodeAddress(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeAddress(p, d) - expectedOp := []map[string]interface{}{{"class_id": "kubernetes.NodeAddress", "object_type": "kubernetes.NodeAddress", "address": "Address 1", "type": "Type 1"}, {"class_id": "kubernetes.NodeAddress", "object_type": "kubernetes.NodeAddress", "address": "Address 2", "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"address": "Address 1", "type": "Type 1", "object_type": "kubernetes.NodeAddress", "class_id": "kubernetes.NodeAddress"}, {"address": "Address 2", "type": "Type 2", "object_type": "kubernetes.NodeAddress", "class_id": "kubernetes.NodeAddress"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4352,7 +4352,7 @@ func TestFlattenListKubernetesNodeAddress(t *testing.T) { func TestFlattenListKubernetesNodeGroupLabel(t *testing.T) { p := []models.KubernetesNodeGroupLabel{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.NodeGroupLabel","ObjectType":"kubernetes.NodeGroupLabel","Key":"Key %d","Value":"Value %d"}` + c := `{"ObjectType":"kubernetes.NodeGroupLabel","ClassId":"kubernetes.NodeGroupLabel","Key":"Key %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeGroupLabel(p, d) @@ -4367,7 +4367,7 @@ func TestFlattenListKubernetesNodeGroupLabel(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeGroupLabel(p, d) - expectedOp := []map[string]interface{}{{"class_id": "kubernetes.NodeGroupLabel", "object_type": "kubernetes.NodeGroupLabel", "key": "Key 1", "value": "Value 1"}, {"class_id": "kubernetes.NodeGroupLabel", "object_type": "kubernetes.NodeGroupLabel", "key": "Key 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"object_type": "kubernetes.NodeGroupLabel", "class_id": "kubernetes.NodeGroupLabel", "key": "Key 1", "value": "Value 1"}, {"object_type": "kubernetes.NodeGroupLabel", "class_id": "kubernetes.NodeGroupLabel", "key": "Key 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4376,7 +4376,7 @@ func TestFlattenListKubernetesNodeGroupLabel(t *testing.T) { func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { p := []models.KubernetesNodeGroupProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeGroupProfileRelationship(p, d) @@ -4391,7 +4391,7 @@ func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeGroupProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4400,7 +4400,7 @@ func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { p := []models.KubernetesNodeGroupTaint{} var d = &schema.ResourceData{} - c := `{"Effect":"Effect %d","Key":"Key %d","Value":"Value %d","ClassId":"kubernetes.NodeGroupTaint","ObjectType":"kubernetes.NodeGroupTaint"}` + c := `{"Key":"Key %d","Value":"Value %d","ClassId":"kubernetes.NodeGroupTaint","ObjectType":"kubernetes.NodeGroupTaint","Effect":"Effect %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeGroupTaint(p, d) @@ -4415,7 +4415,7 @@ func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeGroupTaint(p, d) - expectedOp := []map[string]interface{}{{"effect": "Effect 1", "key": "Key 1", "value": "Value 1", "class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint"}, {"effect": "Effect 2", "key": "Key 2", "value": "Value 2", "class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint"}} + expectedOp := []map[string]interface{}{{"key": "Key 1", "value": "Value 1", "class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint", "effect": "Effect 1"}, {"key": "Key 2", "value": "Value 2", "class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint", "effect": "Effect 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4424,7 +4424,7 @@ func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { func TestFlattenListKubernetesNodeProfileRelationship(t *testing.T) { p := []models.KubernetesNodeProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeProfileRelationship(p, d) @@ -4439,7 +4439,7 @@ func TestFlattenListKubernetesNodeProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4448,7 +4448,7 @@ func TestFlattenListKubernetesNodeProfileRelationship(t *testing.T) { func TestFlattenListKubernetesNodeStatus(t *testing.T) { p := []models.KubernetesNodeStatus{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.NodeStatus","ObjectType":"kubernetes.NodeStatus","Status":"Status %d","Type":"Type %d"}` + c := `{"ObjectType":"kubernetes.NodeStatus","ClassId":"kubernetes.NodeStatus","Status":"Status %d","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeStatus(p, d) @@ -4463,7 +4463,7 @@ func TestFlattenListKubernetesNodeStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeStatus(p, d) - expectedOp := []map[string]interface{}{{"class_id": "kubernetes.NodeStatus", "object_type": "kubernetes.NodeStatus", "status": "Status 1", "type": "Type 1"}, {"class_id": "kubernetes.NodeStatus", "object_type": "kubernetes.NodeStatus", "status": "Status 2", "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"object_type": "kubernetes.NodeStatus", "class_id": "kubernetes.NodeStatus", "status": "Status 1", "type": "Type 1"}, {"object_type": "kubernetes.NodeStatus", "class_id": "kubernetes.NodeStatus", "status": "Status 2", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4472,7 +4472,7 @@ func TestFlattenListKubernetesNodeStatus(t *testing.T) { func TestFlattenListKubernetesVirtualMachineInfrastructureProviderRelationship(t *testing.T) { p := []models.KubernetesVirtualMachineInfrastructureProviderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesVirtualMachineInfrastructureProviderRelationship(p, d) @@ -4487,7 +4487,7 @@ func TestFlattenListKubernetesVirtualMachineInfrastructureProviderRelationship(t p = append(p, x) } ffOp := flattenListKubernetesVirtualMachineInfrastructureProviderRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4520,7 +4520,7 @@ func TestFlattenListLicenseLicenseInfoRelationship(t *testing.T) { func TestFlattenListMacpoolBlock(t *testing.T) { p := []models.MacpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"macpool.Block","ObjectType":"macpool.Block","Size":32,"From":"From %d","To":"To %d"}` + c := `{"From":"From %d","ClassId":"macpool.Block","ObjectType":"macpool.Block","Size":32,"To":"To %d"}` //test when the response is empty ffOpEmpty := flattenListMacpoolBlock(p, d) @@ -4535,7 +4535,7 @@ func TestFlattenListMacpoolBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListMacpoolBlock(p, d) - expectedOp := []map[string]interface{}{{"class_id": "macpool.Block", "object_type": "macpool.Block", "size": 32, "from": "From 1", "to": "To 1"}, {"class_id": "macpool.Block", "object_type": "macpool.Block", "size": 32, "from": "From 2", "to": "To 2"}} + expectedOp := []map[string]interface{}{{"from": "From 1", "class_id": "macpool.Block", "object_type": "macpool.Block", "size": 32, "to": "To 1"}, {"from": "From 2", "class_id": "macpool.Block", "object_type": "macpool.Block", "size": 32, "to": "To 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4544,7 +4544,7 @@ func TestFlattenListMacpoolBlock(t *testing.T) { func TestFlattenListMacpoolIdBlockRelationship(t *testing.T) { p := []models.MacpoolIdBlockRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMacpoolIdBlockRelationship(p, d) @@ -4559,7 +4559,7 @@ func TestFlattenListMacpoolIdBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMacpoolIdBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4568,7 +4568,7 @@ func TestFlattenListMacpoolIdBlockRelationship(t *testing.T) { func TestFlattenListManagementInterfaceRelationship(t *testing.T) { p := []models.ManagementInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListManagementInterfaceRelationship(p, d) @@ -4583,7 +4583,7 @@ func TestFlattenListManagementInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListManagementInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4592,7 +4592,7 @@ func TestFlattenListManagementInterfaceRelationship(t *testing.T) { func TestFlattenListMemoryArrayRelationship(t *testing.T) { p := []models.MemoryArrayRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMemoryArrayRelationship(p, d) @@ -4607,7 +4607,7 @@ func TestFlattenListMemoryArrayRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryArrayRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4616,7 +4616,7 @@ func TestFlattenListMemoryArrayRelationship(t *testing.T) { func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { p := []models.MemoryPersistentMemoryGoal{} var d = &schema.ResourceData{} - c := `{"PersistentMemoryType":"PersistentMemoryType %d","SocketId":"SocketId %d","ClassId":"memory.PersistentMemoryGoal","ObjectType":"memory.PersistentMemoryGoal","MemoryModePercentage":32}` + c := `{"ClassId":"memory.PersistentMemoryGoal","ObjectType":"memory.PersistentMemoryGoal","MemoryModePercentage":32,"PersistentMemoryType":"PersistentMemoryType %d","SocketId":"SocketId %d"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryGoal(p, d) @@ -4631,7 +4631,7 @@ func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryGoal(p, d) - expectedOp := []map[string]interface{}{{"persistent_memory_type": "PersistentMemoryType 1", "socket_id": "SocketId 1", "class_id": "memory.PersistentMemoryGoal", "object_type": "memory.PersistentMemoryGoal", "memory_mode_percentage": 32}, {"persistent_memory_type": "PersistentMemoryType 2", "socket_id": "SocketId 2", "class_id": "memory.PersistentMemoryGoal", "object_type": "memory.PersistentMemoryGoal", "memory_mode_percentage": 32}} + expectedOp := []map[string]interface{}{{"class_id": "memory.PersistentMemoryGoal", "object_type": "memory.PersistentMemoryGoal", "memory_mode_percentage": 32, "persistent_memory_type": "PersistentMemoryType 1", "socket_id": "SocketId 1"}, {"class_id": "memory.PersistentMemoryGoal", "object_type": "memory.PersistentMemoryGoal", "memory_mode_percentage": 32, "persistent_memory_type": "PersistentMemoryType 2", "socket_id": "SocketId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4640,7 +4640,7 @@ func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { func TestFlattenListMemoryPersistentMemoryLogicalNamespace(t *testing.T) { p := []models.MemoryPersistentMemoryLogicalNamespace{} var d = &schema.ResourceData{} - c := `{"Mode":"Mode %d","Name":"Name %d","ClassId":"memory.PersistentMemoryLogicalNamespace","ObjectType":"memory.PersistentMemoryLogicalNamespace","SocketId":32,"SocketMemoryId":"SocketMemoryId %d","Capacity":32}` + c := `{"ClassId":"memory.PersistentMemoryLogicalNamespace","Capacity":32,"Mode":"Mode %d","Name":"Name %d","SocketId":32,"SocketMemoryId":"SocketMemoryId %d","ObjectType":"memory.PersistentMemoryLogicalNamespace"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryLogicalNamespace(p, d) @@ -4655,7 +4655,7 @@ func TestFlattenListMemoryPersistentMemoryLogicalNamespace(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryLogicalNamespace(p, d) - expectedOp := []map[string]interface{}{{"mode": "Mode 1", "name": "Name 1", "class_id": "memory.PersistentMemoryLogicalNamespace", "object_type": "memory.PersistentMemoryLogicalNamespace", "socket_id": 32, "socket_memory_id": "SocketMemoryId 1", "capacity": 32}, {"mode": "Mode 2", "name": "Name 2", "class_id": "memory.PersistentMemoryLogicalNamespace", "object_type": "memory.PersistentMemoryLogicalNamespace", "socket_id": 32, "socket_memory_id": "SocketMemoryId 2", "capacity": 32}} + expectedOp := []map[string]interface{}{{"class_id": "memory.PersistentMemoryLogicalNamespace", "capacity": 32, "mode": "Mode 1", "name": "Name 1", "socket_id": 32, "socket_memory_id": "SocketMemoryId 1", "object_type": "memory.PersistentMemoryLogicalNamespace"}, {"class_id": "memory.PersistentMemoryLogicalNamespace", "capacity": 32, "mode": "Mode 2", "name": "Name 2", "socket_id": 32, "socket_memory_id": "SocketMemoryId 2", "object_type": "memory.PersistentMemoryLogicalNamespace"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4664,7 +4664,7 @@ func TestFlattenListMemoryPersistentMemoryLogicalNamespace(t *testing.T) { func TestFlattenListMemoryPersistentMemoryNamespaceRelationship(t *testing.T) { p := []models.MemoryPersistentMemoryNamespaceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryNamespaceRelationship(p, d) @@ -4679,7 +4679,7 @@ func TestFlattenListMemoryPersistentMemoryNamespaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryNamespaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4688,7 +4688,7 @@ func TestFlattenListMemoryPersistentMemoryNamespaceRelationship(t *testing.T) { func TestFlattenListMemoryPersistentMemoryNamespaceConfigResultRelationship(t *testing.T) { p := []models.MemoryPersistentMemoryNamespaceConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryNamespaceConfigResultRelationship(p, d) @@ -4703,7 +4703,7 @@ func TestFlattenListMemoryPersistentMemoryNamespaceConfigResultRelationship(t *t p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryNamespaceConfigResultRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4736,7 +4736,7 @@ func TestFlattenListMemoryPersistentMemoryRegionRelationship(t *testing.T) { func TestFlattenListMemoryPersistentMemoryUnitRelationship(t *testing.T) { p := []models.MemoryPersistentMemoryUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryUnitRelationship(p, d) @@ -4751,7 +4751,7 @@ func TestFlattenListMemoryPersistentMemoryUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4760,7 +4760,7 @@ func TestFlattenListMemoryPersistentMemoryUnitRelationship(t *testing.T) { func TestFlattenListMemoryUnitRelationship(t *testing.T) { p := []models.MemoryUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListMemoryUnitRelationship(p, d) @@ -4775,7 +4775,7 @@ func TestFlattenListMemoryUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4784,7 +4784,7 @@ func TestFlattenListMemoryUnitRelationship(t *testing.T) { func TestFlattenListMetaAccessPrivilege(t *testing.T) { p := []models.MetaAccessPrivilege{} var d = &schema.ResourceData{} - c := `{"Privilege":"Privilege %d","Method":"Method %d","ClassId":"meta.AccessPrivilege","ObjectType":"meta.AccessPrivilege"}` + c := `{"ObjectType":"meta.AccessPrivilege","Privilege":"Privilege %d","Method":"Method %d","ClassId":"meta.AccessPrivilege"}` //test when the response is empty ffOpEmpty := flattenListMetaAccessPrivilege(p, d) @@ -4799,7 +4799,7 @@ func TestFlattenListMetaAccessPrivilege(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaAccessPrivilege(p, d) - expectedOp := []map[string]interface{}{{"privilege": "Privilege 1", "method": "Method 1", "class_id": "meta.AccessPrivilege", "object_type": "meta.AccessPrivilege"}, {"privilege": "Privilege 2", "method": "Method 2", "class_id": "meta.AccessPrivilege", "object_type": "meta.AccessPrivilege"}} + expectedOp := []map[string]interface{}{{"object_type": "meta.AccessPrivilege", "privilege": "Privilege 1", "method": "Method 1", "class_id": "meta.AccessPrivilege"}, {"object_type": "meta.AccessPrivilege", "privilege": "Privilege 2", "method": "Method 2", "class_id": "meta.AccessPrivilege"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4808,7 +4808,7 @@ func TestFlattenListMetaAccessPrivilege(t *testing.T) { func TestFlattenListMetaDisplayNameDefinition(t *testing.T) { p := []models.MetaDisplayNameDefinition{} var d = &schema.ResourceData{} - c := `{"Format":"Format %d","IncludeAncestor":true,"ClassId":"meta.DisplayNameDefinition","ObjectType":"meta.DisplayNameDefinition","Name":"Name %d"}` + c := `{"ClassId":"meta.DisplayNameDefinition","ObjectType":"meta.DisplayNameDefinition","IncludeAncestor":true,"Name":"Name %d","Format":"Format %d"}` //test when the response is empty ffOpEmpty := flattenListMetaDisplayNameDefinition(p, d) @@ -4823,7 +4823,7 @@ func TestFlattenListMetaDisplayNameDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaDisplayNameDefinition(p, d) - expectedOp := []map[string]interface{}{{"format": "Format 1", "include_ancestor": true, "class_id": "meta.DisplayNameDefinition", "object_type": "meta.DisplayNameDefinition", "name": "Name 1"}, {"format": "Format 2", "include_ancestor": true, "class_id": "meta.DisplayNameDefinition", "object_type": "meta.DisplayNameDefinition", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"class_id": "meta.DisplayNameDefinition", "object_type": "meta.DisplayNameDefinition", "include_ancestor": true, "name": "Name 1", "format": "Format 1"}, {"class_id": "meta.DisplayNameDefinition", "object_type": "meta.DisplayNameDefinition", "include_ancestor": true, "name": "Name 2", "format": "Format 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4832,7 +4832,7 @@ func TestFlattenListMetaDisplayNameDefinition(t *testing.T) { func TestFlattenListMetaPropDefinition(t *testing.T) { p := []models.MetaPropDefinition{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","OpSecurity":"OpSecurity %d","SearchWeight":32.000000,"ClassId":"meta.PropDefinition","ObjectType":"meta.PropDefinition","ApiAccess":"ApiAccess %d"}` + c := `{"ClassId":"meta.PropDefinition","ObjectType":"meta.PropDefinition","ApiAccess":"ApiAccess %d","Name":"Name %d","OpSecurity":"OpSecurity %d","SearchWeight":32.000000}` //test when the response is empty ffOpEmpty := flattenListMetaPropDefinition(p, d) @@ -4847,7 +4847,7 @@ func TestFlattenListMetaPropDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaPropDefinition(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "op_security": "OpSecurity 1", "search_weight": 32.000000, "class_id": "meta.PropDefinition", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 1"}, {"name": "Name 2", "op_security": "OpSecurity 2", "search_weight": 32.000000, "class_id": "meta.PropDefinition", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 2"}} + expectedOp := []map[string]interface{}{{"class_id": "meta.PropDefinition", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 1", "name": "Name 1", "op_security": "OpSecurity 1", "search_weight": 32.000000}, {"class_id": "meta.PropDefinition", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 2", "name": "Name 2", "op_security": "OpSecurity 2", "search_weight": 32.000000}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4856,7 +4856,7 @@ func TestFlattenListMetaPropDefinition(t *testing.T) { func TestFlattenListMetaRelationshipDefinition(t *testing.T) { p := []models.MetaRelationshipDefinition{} var d = &schema.ResourceData{} - c := `{"ApiAccess":"ApiAccess %d","ObjectType":"meta.RelationshipDefinition","ExportWithPeer":true,"Export":true,"Collection":true,"Type":"Type %d","ClassId":"meta.RelationshipDefinition","PeerSync":true,"Name":"Name %d","PeerRelName":"PeerRelName %d"}` + c := `{"ObjectType":"meta.RelationshipDefinition","ExportWithPeer":true,"Type":"Type %d","Export":true,"Name":"Name %d","ClassId":"meta.RelationshipDefinition","Collection":true,"ApiAccess":"ApiAccess %d","PeerSync":true,"PeerRelName":"PeerRelName %d"}` //test when the response is empty ffOpEmpty := flattenListMetaRelationshipDefinition(p, d) @@ -4871,7 +4871,7 @@ func TestFlattenListMetaRelationshipDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaRelationshipDefinition(p, d) - expectedOp := []map[string]interface{}{{"api_access": "ApiAccess 1", "object_type": "meta.RelationshipDefinition", "export_with_peer": true, "export": true, "collection": true, "type": "Type 1", "class_id": "meta.RelationshipDefinition", "peer_sync": true, "name": "Name 1", "peer_rel_name": "PeerRelName 1"}, {"api_access": "ApiAccess 2", "object_type": "meta.RelationshipDefinition", "export_with_peer": true, "export": true, "collection": true, "type": "Type 2", "class_id": "meta.RelationshipDefinition", "peer_sync": true, "name": "Name 2", "peer_rel_name": "PeerRelName 2"}} + expectedOp := []map[string]interface{}{{"object_type": "meta.RelationshipDefinition", "export_with_peer": true, "type": "Type 1", "export": true, "name": "Name 1", "class_id": "meta.RelationshipDefinition", "collection": true, "api_access": "ApiAccess 1", "peer_sync": true, "peer_rel_name": "PeerRelName 1"}, {"object_type": "meta.RelationshipDefinition", "export_with_peer": true, "type": "Type 2", "export": true, "name": "Name 2", "class_id": "meta.RelationshipDefinition", "collection": true, "api_access": "ApiAccess 2", "peer_sync": true, "peer_rel_name": "PeerRelName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4952,7 +4952,7 @@ func TestFlattenListNetworkElementRelationship(t *testing.T) { func TestFlattenListNiaapiDetail(t *testing.T) { p := []models.NiaapiDetail{} var d = &schema.ResourceData{} - c := `{"Chksum":"Chksum %d","Filename":"Filename %d","Name":"Name %d","ClassId":"niaapi.Detail","ObjectType":"niaapi.Detail"}` + c := `{"ObjectType":"niaapi.Detail","ClassId":"niaapi.Detail","Filename":"Filename %d","Name":"Name %d","Chksum":"Chksum %d"}` //test when the response is empty ffOpEmpty := flattenListNiaapiDetail(p, d) @@ -4967,7 +4967,7 @@ func TestFlattenListNiaapiDetail(t *testing.T) { p = append(p, x) } ffOp := flattenListNiaapiDetail(p, d) - expectedOp := []map[string]interface{}{{"chksum": "Chksum 1", "filename": "Filename 1", "name": "Name 1", "class_id": "niaapi.Detail", "object_type": "niaapi.Detail"}, {"chksum": "Chksum 2", "filename": "Filename 2", "name": "Name 2", "class_id": "niaapi.Detail", "object_type": "niaapi.Detail"}} + expectedOp := []map[string]interface{}{{"object_type": "niaapi.Detail", "class_id": "niaapi.Detail", "filename": "Filename 1", "name": "Name 1", "chksum": "Chksum 1"}, {"object_type": "niaapi.Detail", "class_id": "niaapi.Detail", "filename": "Filename 2", "name": "Name 2", "chksum": "Chksum 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4976,7 +4976,7 @@ func TestFlattenListNiaapiDetail(t *testing.T) { func TestFlattenListNiaapiRevisionInfo(t *testing.T) { p := []models.NiaapiRevisionInfo{} var d = &schema.ResourceData{} - c := `{"RevisionNo":"RevisionNo %d","ClassId":"niaapi.RevisionInfo","ObjectType":"niaapi.RevisionInfo","RevisionComment":"RevisionComment %d"}` + c := `{"ClassId":"niaapi.RevisionInfo","RevisionNo":"RevisionNo %d","RevisionComment":"RevisionComment %d","ObjectType":"niaapi.RevisionInfo"}` //test when the response is empty ffOpEmpty := flattenListNiaapiRevisionInfo(p, d) @@ -4991,7 +4991,7 @@ func TestFlattenListNiaapiRevisionInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListNiaapiRevisionInfo(p, d) - expectedOp := []map[string]interface{}{{"revision_no": "RevisionNo 1", "class_id": "niaapi.RevisionInfo", "object_type": "niaapi.RevisionInfo", "revision_comment": "RevisionComment 1"}, {"revision_no": "RevisionNo 2", "class_id": "niaapi.RevisionInfo", "object_type": "niaapi.RevisionInfo", "revision_comment": "RevisionComment 2"}} + expectedOp := []map[string]interface{}{{"class_id": "niaapi.RevisionInfo", "revision_no": "RevisionNo 1", "revision_comment": "RevisionComment 1", "object_type": "niaapi.RevisionInfo"}, {"class_id": "niaapi.RevisionInfo", "revision_no": "RevisionNo 2", "revision_comment": "RevisionComment 2", "object_type": "niaapi.RevisionInfo"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5000,7 +5000,7 @@ func TestFlattenListNiaapiRevisionInfo(t *testing.T) { func TestFlattenListNiatelemetryInterfaceElement(t *testing.T) { p := []models.NiatelemetryInterfaceElement{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"niatelemetry.InterfaceElement","ClassId":"niatelemetry.InterfaceElement","OperState":"OperState %d","XcvrPresent":"XcvrPresent %d"}` + c := `{"XcvrPresent":"XcvrPresent %d","ObjectType":"niatelemetry.InterfaceElement","ClassId":"niatelemetry.InterfaceElement","Name":"Name %d","OperState":"OperState %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryInterfaceElement(p, d) @@ -5015,7 +5015,7 @@ func TestFlattenListNiatelemetryInterfaceElement(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryInterfaceElement(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "niatelemetry.InterfaceElement", "class_id": "niatelemetry.InterfaceElement", "oper_state": "OperState 1", "xcvr_present": "XcvrPresent 1"}, {"name": "Name 2", "object_type": "niatelemetry.InterfaceElement", "class_id": "niatelemetry.InterfaceElement", "oper_state": "OperState 2", "xcvr_present": "XcvrPresent 2"}} + expectedOp := []map[string]interface{}{{"xcvr_present": "XcvrPresent 1", "object_type": "niatelemetry.InterfaceElement", "class_id": "niatelemetry.InterfaceElement", "name": "Name 1", "oper_state": "OperState 1"}, {"xcvr_present": "XcvrPresent 2", "object_type": "niatelemetry.InterfaceElement", "class_id": "niatelemetry.InterfaceElement", "name": "Name 2", "oper_state": "OperState 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5024,7 +5024,7 @@ func TestFlattenListNiatelemetryInterfaceElement(t *testing.T) { func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { p := []models.NiatelemetryLogicalLink{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.LogicalLink","ObjectType":"niatelemetry.LogicalLink","LinkState":"LinkState %d","LinkType":"LinkType %d","Uptime":"Uptime %d","DbId":32,"LinkAddr1":"LinkAddr1 %d","LinkAddr2":"LinkAddr2 %d","IsPresent":true}` + c := `{"ClassId":"niatelemetry.LogicalLink","Uptime":"Uptime %d","LinkState":"LinkState %d","ObjectType":"niatelemetry.LogicalLink","DbId":32,"LinkAddr2":"LinkAddr2 %d","LinkType":"LinkType %d","IsPresent":true,"LinkAddr1":"LinkAddr1 %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryLogicalLink(p, d) @@ -5039,7 +5039,7 @@ func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryLogicalLink(p, d) - expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.LogicalLink", "object_type": "niatelemetry.LogicalLink", "link_state": "LinkState 1", "link_type": "LinkType 1", "uptime": "Uptime 1", "db_id": 32, "link_addr1": "LinkAddr1 1", "link_addr2": "LinkAddr2 1", "is_present": true}, {"class_id": "niatelemetry.LogicalLink", "object_type": "niatelemetry.LogicalLink", "link_state": "LinkState 2", "link_type": "LinkType 2", "uptime": "Uptime 2", "db_id": 32, "link_addr1": "LinkAddr1 2", "link_addr2": "LinkAddr2 2", "is_present": true}} + expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.LogicalLink", "uptime": "Uptime 1", "link_state": "LinkState 1", "object_type": "niatelemetry.LogicalLink", "db_id": 32, "link_addr2": "LinkAddr2 1", "link_type": "LinkType 1", "is_present": true, "link_addr1": "LinkAddr1 1"}, {"class_id": "niatelemetry.LogicalLink", "uptime": "Uptime 2", "link_state": "LinkState 2", "object_type": "niatelemetry.LogicalLink", "db_id": 32, "link_addr2": "LinkAddr2 2", "link_type": "LinkType 2", "is_present": true, "link_addr1": "LinkAddr1 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5048,7 +5048,7 @@ func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { func TestFlattenListNotificationAbstractCondition(t *testing.T) { p := []models.NotificationAbstractCondition{} var d = &schema.ResourceData{} - c := `{"ObjectType":"notification.AbstractCondition","ClassId":"notification.AbstractCondition"}` + c := `{"ClassId":"notification.AbstractCondition","ObjectType":"notification.AbstractCondition"}` //test when the response is empty ffOpEmpty := flattenListNotificationAbstractCondition(p, d) @@ -5063,7 +5063,7 @@ func TestFlattenListNotificationAbstractCondition(t *testing.T) { p = append(p, x) } ffOp := flattenListNotificationAbstractCondition(p, d) - expectedOp := []map[string]interface{}{{"object_type": "notification.AbstractCondition", "class_id": "notification.AbstractCondition"}, {"object_type": "notification.AbstractCondition", "class_id": "notification.AbstractCondition"}} + expectedOp := []map[string]interface{}{{"class_id": "notification.AbstractCondition", "object_type": "notification.AbstractCondition"}, {"class_id": "notification.AbstractCondition", "object_type": "notification.AbstractCondition"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5096,7 +5096,7 @@ func TestFlattenListNotificationAction(t *testing.T) { func TestFlattenListNtpAuthNtpServer(t *testing.T) { p := []models.NtpAuthNtpServer{} var d = &schema.ResourceData{} - c := `{"KeyType":"KeyType %d","ServerName":"ServerName %d","SymKeyId":32,"SymKeyValue":"SymKeyValue %d","ClassId":"ntp.AuthNtpServer","ObjectType":"ntp.AuthNtpServer"}` + c := `{"ClassId":"ntp.AuthNtpServer","ObjectType":"ntp.AuthNtpServer","KeyType":"KeyType %d","ServerName":"ServerName %d","SymKeyId":32,"SymKeyValue":"SymKeyValue %d"}` //test when the response is empty ffOpEmpty := flattenListNtpAuthNtpServer(p, d) @@ -5111,7 +5111,7 @@ func TestFlattenListNtpAuthNtpServer(t *testing.T) { p = append(p, x) } ffOp := flattenListNtpAuthNtpServer(p, d) - expectedOp := []map[string]interface{}{{"key_type": "KeyType 1", "server_name": "ServerName 1", "sym_key_id": 32, "sym_key_value": "SymKeyValue 1", "class_id": "ntp.AuthNtpServer", "object_type": "ntp.AuthNtpServer"}, {"key_type": "KeyType 2", "server_name": "ServerName 2", "sym_key_id": 32, "sym_key_value": "SymKeyValue 2", "class_id": "ntp.AuthNtpServer", "object_type": "ntp.AuthNtpServer"}} + expectedOp := []map[string]interface{}{{"class_id": "ntp.AuthNtpServer", "object_type": "ntp.AuthNtpServer", "key_type": "KeyType 1", "server_name": "ServerName 1", "sym_key_id": 32, "sym_key_value": "SymKeyValue 1"}, {"class_id": "ntp.AuthNtpServer", "object_type": "ntp.AuthNtpServer", "key_type": "KeyType 2", "server_name": "ServerName 2", "sym_key_id": 32, "sym_key_value": "SymKeyValue 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5120,7 +5120,7 @@ func TestFlattenListNtpAuthNtpServer(t *testing.T) { func TestFlattenListOnpremImagePackage(t *testing.T) { p := []models.OnpremImagePackage{} var d = &schema.ResourceData{} - c := `{"FileSha":"FileSha %d","ObjectType":"onprem.ImagePackage","Name":"Name %d","Filename":"Filename %d","FilePath":"FilePath %d","Version":"Version %d","ClassId":"onprem.ImagePackage","PackageType":"PackageType %d","FileSize":32}` + c := `{"FileSha":"FileSha %d","PackageType":"PackageType %d","ObjectType":"onprem.ImagePackage","Filename":"Filename %d","Version":"Version %d","Name":"Name %d","FileSize":32,"ClassId":"onprem.ImagePackage","FilePath":"FilePath %d"}` //test when the response is empty ffOpEmpty := flattenListOnpremImagePackage(p, d) @@ -5135,7 +5135,7 @@ func TestFlattenListOnpremImagePackage(t *testing.T) { p = append(p, x) } ffOp := flattenListOnpremImagePackage(p, d) - expectedOp := []map[string]interface{}{{"file_sha": "FileSha 1", "object_type": "onprem.ImagePackage", "name": "Name 1", "filename": "Filename 1", "file_path": "FilePath 1", "nr_version": "Version 1", "class_id": "onprem.ImagePackage", "package_type": "PackageType 1", "file_size": 32}, {"file_sha": "FileSha 2", "object_type": "onprem.ImagePackage", "name": "Name 2", "filename": "Filename 2", "file_path": "FilePath 2", "nr_version": "Version 2", "class_id": "onprem.ImagePackage", "package_type": "PackageType 2", "file_size": 32}} + expectedOp := []map[string]interface{}{{"file_sha": "FileSha 1", "package_type": "PackageType 1", "object_type": "onprem.ImagePackage", "filename": "Filename 1", "nr_version": "Version 1", "name": "Name 1", "file_size": 32, "class_id": "onprem.ImagePackage", "file_path": "FilePath 1"}, {"file_sha": "FileSha 2", "package_type": "PackageType 2", "object_type": "onprem.ImagePackage", "filename": "Filename 2", "nr_version": "Version 2", "name": "Name 2", "file_size": 32, "class_id": "onprem.ImagePackage", "file_path": "FilePath 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5168,7 +5168,7 @@ func TestFlattenListOnpremUpgradeNote(t *testing.T) { func TestFlattenListOnpremUpgradePhase(t *testing.T) { p := []models.OnpremUpgradePhase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"onprem.UpgradePhase","Message":"Message %d","Name":"Name %d","ElapsedTime":32,"Failed":true,"ClassId":"onprem.UpgradePhase"}` + c := `{"ObjectType":"onprem.UpgradePhase","Failed":true,"Name":"Name %d","ClassId":"onprem.UpgradePhase","ElapsedTime":32,"Message":"Message %d"}` //test when the response is empty ffOpEmpty := flattenListOnpremUpgradePhase(p, d) @@ -5183,7 +5183,7 @@ func TestFlattenListOnpremUpgradePhase(t *testing.T) { p = append(p, x) } ffOp := flattenListOnpremUpgradePhase(p, d) - expectedOp := []map[string]interface{}{{"object_type": "onprem.UpgradePhase", "message": "Message 1", "name": "Name 1", "elapsed_time": 32, "failed": true, "class_id": "onprem.UpgradePhase"}, {"object_type": "onprem.UpgradePhase", "message": "Message 2", "name": "Name 2", "elapsed_time": 32, "failed": true, "class_id": "onprem.UpgradePhase"}} + expectedOp := []map[string]interface{}{{"object_type": "onprem.UpgradePhase", "failed": true, "name": "Name 1", "class_id": "onprem.UpgradePhase", "elapsed_time": 32, "message": "Message 1"}, {"object_type": "onprem.UpgradePhase", "failed": true, "name": "Name 2", "class_id": "onprem.UpgradePhase", "elapsed_time": 32, "message": "Message 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5192,7 +5192,7 @@ func TestFlattenListOnpremUpgradePhase(t *testing.T) { func TestFlattenListOprsKvpair(t *testing.T) { p := []models.OprsKvpair{} var d = &schema.ResourceData{} - c := `{"ClassId":"oprs.Kvpair","ObjectType":"oprs.Kvpair","Key":"Key %d","Value":"Value %d"}` + c := `{"ClassId":"oprs.Kvpair","Key":"Key %d","Value":"Value %d","ObjectType":"oprs.Kvpair"}` //test when the response is empty ffOpEmpty := flattenListOprsKvpair(p, d) @@ -5207,7 +5207,7 @@ func TestFlattenListOprsKvpair(t *testing.T) { p = append(p, x) } ffOp := flattenListOprsKvpair(p, d) - expectedOp := []map[string]interface{}{{"class_id": "oprs.Kvpair", "object_type": "oprs.Kvpair", "key": "Key 1", "value": "Value 1"}, {"class_id": "oprs.Kvpair", "object_type": "oprs.Kvpair", "key": "Key 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"class_id": "oprs.Kvpair", "key": "Key 1", "value": "Value 1", "object_type": "oprs.Kvpair"}, {"class_id": "oprs.Kvpair", "key": "Key 2", "value": "Value 2", "object_type": "oprs.Kvpair"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5216,7 +5216,7 @@ func TestFlattenListOprsKvpair(t *testing.T) { func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { p := []models.OrganizationOrganizationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListOrganizationOrganizationRelationship(p, d) @@ -5231,7 +5231,7 @@ func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListOrganizationOrganizationRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5240,7 +5240,7 @@ func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { func TestFlattenListOsConfigurationFileRelationship(t *testing.T) { p := []models.OsConfigurationFileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListOsConfigurationFileRelationship(p, d) @@ -5255,7 +5255,7 @@ func TestFlattenListOsConfigurationFileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListOsConfigurationFileRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5288,7 +5288,7 @@ func TestFlattenListOsDistributionRelationship(t *testing.T) { func TestFlattenListOsPlaceHolder(t *testing.T) { p := []models.OsPlaceHolder{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.PlaceHolder","ObjectType":"os.PlaceHolder","IsValueSet":true}` + c := `{"ObjectType":"os.PlaceHolder","ClassId":"os.PlaceHolder","IsValueSet":true}` //test when the response is empty ffOpEmpty := flattenListOsPlaceHolder(p, d) @@ -5303,7 +5303,7 @@ func TestFlattenListOsPlaceHolder(t *testing.T) { p = append(p, x) } ffOp := flattenListOsPlaceHolder(p, d) - expectedOp := []map[string]interface{}{{"class_id": "os.PlaceHolder", "object_type": "os.PlaceHolder", "is_value_set": true}, {"class_id": "os.PlaceHolder", "object_type": "os.PlaceHolder", "is_value_set": true}} + expectedOp := []map[string]interface{}{{"object_type": "os.PlaceHolder", "class_id": "os.PlaceHolder", "is_value_set": true}, {"object_type": "os.PlaceHolder", "class_id": "os.PlaceHolder", "is_value_set": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5312,7 +5312,7 @@ func TestFlattenListOsPlaceHolder(t *testing.T) { func TestFlattenListOsServerConfig(t *testing.T) { p := []models.OsServerConfig{} var d = &schema.ResourceData{} - c := `{"SerialNumber":"SerialNumber %d","ClassId":"os.ServerConfig","ObjectType":"os.ServerConfig","InstallTarget":"InstallTarget %d"}` + c := `{"ClassId":"os.ServerConfig","ObjectType":"os.ServerConfig","InstallTarget":"InstallTarget %d","SerialNumber":"SerialNumber %d"}` //test when the response is empty ffOpEmpty := flattenListOsServerConfig(p, d) @@ -5327,7 +5327,7 @@ func TestFlattenListOsServerConfig(t *testing.T) { p = append(p, x) } ffOp := flattenListOsServerConfig(p, d) - expectedOp := []map[string]interface{}{{"serial_number": "SerialNumber 1", "class_id": "os.ServerConfig", "object_type": "os.ServerConfig", "install_target": "InstallTarget 1"}, {"serial_number": "SerialNumber 2", "class_id": "os.ServerConfig", "object_type": "os.ServerConfig", "install_target": "InstallTarget 2"}} + expectedOp := []map[string]interface{}{{"class_id": "os.ServerConfig", "object_type": "os.ServerConfig", "install_target": "InstallTarget 1", "serial_number": "SerialNumber 1"}, {"class_id": "os.ServerConfig", "object_type": "os.ServerConfig", "install_target": "InstallTarget 2", "serial_number": "SerialNumber 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5336,7 +5336,7 @@ func TestFlattenListOsServerConfig(t *testing.T) { func TestFlattenListOsValidationInformation(t *testing.T) { p := []models.OsValidationInformation{} var d = &schema.ResourceData{} - c := `{"Status":"Status %d","StepName":"StepName %d","ClassId":"os.ValidationInformation","ObjectType":"os.ValidationInformation","ErrorMsg":"ErrorMsg %d"}` + c := `{"StepName":"StepName %d","ClassId":"os.ValidationInformation","ObjectType":"os.ValidationInformation","ErrorMsg":"ErrorMsg %d","Status":"Status %d"}` //test when the response is empty ffOpEmpty := flattenListOsValidationInformation(p, d) @@ -5351,7 +5351,7 @@ func TestFlattenListOsValidationInformation(t *testing.T) { p = append(p, x) } ffOp := flattenListOsValidationInformation(p, d) - expectedOp := []map[string]interface{}{{"status": "Status 1", "step_name": "StepName 1", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 1"}, {"status": "Status 2", "step_name": "StepName 2", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 2"}} + expectedOp := []map[string]interface{}{{"step_name": "StepName 1", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 1", "status": "Status 1"}, {"step_name": "StepName 2", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 2", "status": "Status 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5360,7 +5360,7 @@ func TestFlattenListOsValidationInformation(t *testing.T) { func TestFlattenListPciCoprocessorCardRelationship(t *testing.T) { p := []models.PciCoprocessorCardRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPciCoprocessorCardRelationship(p, d) @@ -5375,7 +5375,7 @@ func TestFlattenListPciCoprocessorCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPciCoprocessorCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5384,7 +5384,7 @@ func TestFlattenListPciCoprocessorCardRelationship(t *testing.T) { func TestFlattenListPciDeviceRelationship(t *testing.T) { p := []models.PciDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListPciDeviceRelationship(p, d) @@ -5399,7 +5399,7 @@ func TestFlattenListPciDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPciDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5408,7 +5408,7 @@ func TestFlattenListPciDeviceRelationship(t *testing.T) { func TestFlattenListPciLinkRelationship(t *testing.T) { p := []models.PciLinkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPciLinkRelationship(p, d) @@ -5423,7 +5423,7 @@ func TestFlattenListPciLinkRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPciLinkRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5456,7 +5456,7 @@ func TestFlattenListPciSwitchRelationship(t *testing.T) { func TestFlattenListPolicyAbstractConfigProfileRelationship(t *testing.T) { p := []models.PolicyAbstractConfigProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPolicyAbstractConfigProfileRelationship(p, d) @@ -5471,7 +5471,7 @@ func TestFlattenListPolicyAbstractConfigProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPolicyAbstractConfigProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5480,7 +5480,7 @@ func TestFlattenListPolicyAbstractConfigProfileRelationship(t *testing.T) { func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { p := []models.PolicyAbstractPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPolicyAbstractPolicyRelationship(p, d) @@ -5495,7 +5495,7 @@ func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPolicyAbstractPolicyRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5504,7 +5504,7 @@ func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { func TestFlattenListPolicyinventoryJobInfo(t *testing.T) { p := []models.PolicyinventoryJobInfo{} var d = &schema.ResourceData{} - c := `{"PolicyName":"PolicyName %d","ExecutionStatus":"ExecutionStatus %d","ClassId":"policyinventory.JobInfo","ObjectType":"policyinventory.JobInfo","PolicyId":"PolicyId %d"}` + c := `{"PolicyName":"PolicyName %d","ClassId":"policyinventory.JobInfo","ObjectType":"policyinventory.JobInfo","ExecutionStatus":"ExecutionStatus %d","PolicyId":"PolicyId %d"}` //test when the response is empty ffOpEmpty := flattenListPolicyinventoryJobInfo(p, d) @@ -5519,7 +5519,7 @@ func TestFlattenListPolicyinventoryJobInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListPolicyinventoryJobInfo(p, d) - expectedOp := []map[string]interface{}{{"policy_name": "PolicyName 1", "execution_status": "ExecutionStatus 1", "class_id": "policyinventory.JobInfo", "object_type": "policyinventory.JobInfo", "policy_id": "PolicyId 1"}, {"policy_name": "PolicyName 2", "execution_status": "ExecutionStatus 2", "class_id": "policyinventory.JobInfo", "object_type": "policyinventory.JobInfo", "policy_id": "PolicyId 2"}} + expectedOp := []map[string]interface{}{{"policy_name": "PolicyName 1", "class_id": "policyinventory.JobInfo", "object_type": "policyinventory.JobInfo", "execution_status": "ExecutionStatus 1", "policy_id": "PolicyId 1"}, {"policy_name": "PolicyName 2", "class_id": "policyinventory.JobInfo", "object_type": "policyinventory.JobInfo", "execution_status": "ExecutionStatus 2", "policy_id": "PolicyId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5528,7 +5528,7 @@ func TestFlattenListPolicyinventoryJobInfo(t *testing.T) { func TestFlattenListPortGroupRelationship(t *testing.T) { p := []models.PortGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPortGroupRelationship(p, d) @@ -5543,7 +5543,7 @@ func TestFlattenListPortGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPortGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5600,7 +5600,7 @@ func TestFlattenListPortSubGroupRelationship(t *testing.T) { func TestFlattenListProcessorUnitRelationship(t *testing.T) { p := []models.ProcessorUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListProcessorUnitRelationship(p, d) @@ -5615,7 +5615,7 @@ func TestFlattenListProcessorUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListProcessorUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5672,7 +5672,7 @@ func TestFlattenListRecoveryBackupProfileRelationship(t *testing.T) { func TestFlattenListRecoveryConfigResultEntryRelationship(t *testing.T) { p := []models.RecoveryConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListRecoveryConfigResultEntryRelationship(p, d) @@ -5687,7 +5687,7 @@ func TestFlattenListRecoveryConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListRecoveryConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5720,7 +5720,7 @@ func TestFlattenListResourceGroupRelationship(t *testing.T) { func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { p := []models.ResourcePerTypeCombinedSelector{} var d = &schema.ResourceData{} - c := `{"EmptyFilter":true,"SelectorObjectType":"SelectorObjectType %d","ClassId":"resource.PerTypeCombinedSelector","ObjectType":"resource.PerTypeCombinedSelector","CombinedSelector":"CombinedSelector %d"}` + c := `{"ClassId":"resource.PerTypeCombinedSelector","ObjectType":"resource.PerTypeCombinedSelector","CombinedSelector":"CombinedSelector %d","EmptyFilter":true,"SelectorObjectType":"SelectorObjectType %d"}` //test when the response is empty ffOpEmpty := flattenListResourcePerTypeCombinedSelector(p, d) @@ -5735,7 +5735,7 @@ func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { p = append(p, x) } ffOp := flattenListResourcePerTypeCombinedSelector(p, d) - expectedOp := []map[string]interface{}{{"empty_filter": true, "selector_object_type": "SelectorObjectType 1", "class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector", "combined_selector": "CombinedSelector 1"}, {"empty_filter": true, "selector_object_type": "SelectorObjectType 2", "class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector", "combined_selector": "CombinedSelector 2"}} + expectedOp := []map[string]interface{}{{"class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector", "combined_selector": "CombinedSelector 1", "empty_filter": true, "selector_object_type": "SelectorObjectType 1"}, {"class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector", "combined_selector": "CombinedSelector 2", "empty_filter": true, "selector_object_type": "SelectorObjectType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5744,7 +5744,7 @@ func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { func TestFlattenListResourceSelector(t *testing.T) { p := []models.ResourceSelector{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"resource.Selector","ObjectType":"resource.Selector"}` + c := `{"ClassId":"resource.Selector","ObjectType":"resource.Selector","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListResourceSelector(p, d) @@ -5759,7 +5759,7 @@ func TestFlattenListResourceSelector(t *testing.T) { p = append(p, x) } ffOp := flattenListResourceSelector(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "resource.Selector", "object_type": "resource.Selector"}, {"selector": "Selector 2", "class_id": "resource.Selector", "object_type": "resource.Selector"}} + expectedOp := []map[string]interface{}{{"class_id": "resource.Selector", "object_type": "resource.Selector", "selector": "Selector 1"}, {"class_id": "resource.Selector", "object_type": "resource.Selector", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5768,7 +5768,7 @@ func TestFlattenListResourceSelector(t *testing.T) { func TestFlattenListSdcardPartition(t *testing.T) { p := []models.SdcardPartition{} var d = &schema.ResourceData{} - c := `{"ObjectType":"sdcard.Partition","Type":"Type %d","ClassId":"sdcard.Partition"}` + c := `{"ObjectType":"sdcard.Partition","ClassId":"sdcard.Partition","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListSdcardPartition(p, d) @@ -5783,7 +5783,7 @@ func TestFlattenListSdcardPartition(t *testing.T) { p = append(p, x) } ffOp := flattenListSdcardPartition(p, d) - expectedOp := []map[string]interface{}{{"object_type": "sdcard.Partition", "type": "Type 1", "class_id": "sdcard.Partition"}, {"object_type": "sdcard.Partition", "type": "Type 2", "class_id": "sdcard.Partition"}} + expectedOp := []map[string]interface{}{{"object_type": "sdcard.Partition", "class_id": "sdcard.Partition", "type": "Type 1"}, {"object_type": "sdcard.Partition", "class_id": "sdcard.Partition", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5792,7 +5792,7 @@ func TestFlattenListSdcardPartition(t *testing.T) { func TestFlattenListSdwanNetworkConfigurationType(t *testing.T) { p := []models.SdwanNetworkConfigurationType{} var d = &schema.ResourceData{} - c := `{"PortGroup":"PortGroup %d","Vlan":32,"NetworkType":"NetworkType %d","ClassId":"sdwan.NetworkConfigurationType","ObjectType":"sdwan.NetworkConfigurationType"}` + c := `{"ObjectType":"sdwan.NetworkConfigurationType","ClassId":"sdwan.NetworkConfigurationType","PortGroup":"PortGroup %d","Vlan":32,"NetworkType":"NetworkType %d"}` //test when the response is empty ffOpEmpty := flattenListSdwanNetworkConfigurationType(p, d) @@ -5807,7 +5807,7 @@ func TestFlattenListSdwanNetworkConfigurationType(t *testing.T) { p = append(p, x) } ffOp := flattenListSdwanNetworkConfigurationType(p, d) - expectedOp := []map[string]interface{}{{"port_group": "PortGroup 1", "vlan": 32, "network_type": "NetworkType 1", "class_id": "sdwan.NetworkConfigurationType", "object_type": "sdwan.NetworkConfigurationType"}, {"port_group": "PortGroup 2", "vlan": 32, "network_type": "NetworkType 2", "class_id": "sdwan.NetworkConfigurationType", "object_type": "sdwan.NetworkConfigurationType"}} + expectedOp := []map[string]interface{}{{"object_type": "sdwan.NetworkConfigurationType", "class_id": "sdwan.NetworkConfigurationType", "port_group": "PortGroup 1", "vlan": 32, "network_type": "NetworkType 1"}, {"object_type": "sdwan.NetworkConfigurationType", "class_id": "sdwan.NetworkConfigurationType", "port_group": "PortGroup 2", "vlan": 32, "network_type": "NetworkType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5816,7 +5816,7 @@ func TestFlattenListSdwanNetworkConfigurationType(t *testing.T) { func TestFlattenListSdwanProfileRelationship(t *testing.T) { p := []models.SdwanProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListSdwanProfileRelationship(p, d) @@ -5831,7 +5831,7 @@ func TestFlattenListSdwanProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSdwanProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5864,7 +5864,7 @@ func TestFlattenListSdwanRouterNodeRelationship(t *testing.T) { func TestFlattenListSdwanTemplateInputsType(t *testing.T) { p := []models.SdwanTemplateInputsType{} var d = &schema.ResourceData{} - c := `{"ClassId":"sdwan.TemplateInputsType","ObjectType":"sdwan.TemplateInputsType","Template":"Template %d","Editable":true,"Key":"Key %d","Title":"Title %d","Value":"Value %d","Required":true,"Type":"Type %d"}` + c := `{"Type":"Type %d","ObjectType":"sdwan.TemplateInputsType","Template":"Template %d","Editable":true,"Required":true,"ClassId":"sdwan.TemplateInputsType","Title":"Title %d","Value":"Value %d","Key":"Key %d"}` //test when the response is empty ffOpEmpty := flattenListSdwanTemplateInputsType(p, d) @@ -5879,7 +5879,7 @@ func TestFlattenListSdwanTemplateInputsType(t *testing.T) { p = append(p, x) } ffOp := flattenListSdwanTemplateInputsType(p, d) - expectedOp := []map[string]interface{}{{"class_id": "sdwan.TemplateInputsType", "object_type": "sdwan.TemplateInputsType", "template": "Template 1", "editable": true, "key": "Key 1", "title": "Title 1", "value": "Value 1", "required": true, "type": "Type 1"}, {"class_id": "sdwan.TemplateInputsType", "object_type": "sdwan.TemplateInputsType", "template": "Template 2", "editable": true, "key": "Key 2", "title": "Title 2", "value": "Value 2", "required": true, "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"type": "Type 1", "object_type": "sdwan.TemplateInputsType", "template": "Template 1", "editable": true, "required": true, "class_id": "sdwan.TemplateInputsType", "title": "Title 1", "value": "Value 1", "key": "Key 1"}, {"type": "Type 2", "object_type": "sdwan.TemplateInputsType", "template": "Template 2", "editable": true, "required": true, "class_id": "sdwan.TemplateInputsType", "title": "Title 2", "value": "Value 2", "key": "Key 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5888,7 +5888,7 @@ func TestFlattenListSdwanTemplateInputsType(t *testing.T) { func TestFlattenListSecurityUnitRelationship(t *testing.T) { p := []models.SecurityUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListSecurityUnitRelationship(p, d) @@ -5903,7 +5903,7 @@ func TestFlattenListSecurityUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSecurityUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5912,7 +5912,7 @@ func TestFlattenListSecurityUnitRelationship(t *testing.T) { func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { p := []models.ServerConfigChangeDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListServerConfigChangeDetailRelationship(p, d) @@ -5927,7 +5927,7 @@ func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListServerConfigChangeDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5936,7 +5936,7 @@ func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { p := []models.ServerConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListServerConfigResultEntryRelationship(p, d) @@ -5951,7 +5951,7 @@ func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListServerConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5960,7 +5960,7 @@ func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { func TestFlattenListSnmpTrap(t *testing.T) { p := []models.SnmpTrap{} var d = &schema.ResourceData{} - c := `{"ObjectType":"snmp.Trap","ClassId":"snmp.Trap","Destination":"Destination %d","User":"User %d","Port":32,"Enabled":true,"Version":"Version %d","Type":"Type %d","Community":"Community %d"}` + c := `{"ClassId":"snmp.Trap","Enabled":true,"User":"User %d","Version":"Version %d","Port":32,"ObjectType":"snmp.Trap","Community":"Community %d","Destination":"Destination %d","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListSnmpTrap(p, d) @@ -5975,7 +5975,7 @@ func TestFlattenListSnmpTrap(t *testing.T) { p = append(p, x) } ffOp := flattenListSnmpTrap(p, d) - expectedOp := []map[string]interface{}{{"object_type": "snmp.Trap", "class_id": "snmp.Trap", "destination": "Destination 1", "user": "User 1", "port": 32, "enabled": true, "nr_version": "Version 1", "type": "Type 1", "community": "Community 1"}, {"object_type": "snmp.Trap", "class_id": "snmp.Trap", "destination": "Destination 2", "user": "User 2", "port": 32, "enabled": true, "nr_version": "Version 2", "type": "Type 2", "community": "Community 2"}} + expectedOp := []map[string]interface{}{{"class_id": "snmp.Trap", "enabled": true, "user": "User 1", "nr_version": "Version 1", "port": 32, "object_type": "snmp.Trap", "community": "Community 1", "destination": "Destination 1", "type": "Type 1"}, {"class_id": "snmp.Trap", "enabled": true, "user": "User 2", "nr_version": "Version 2", "port": 32, "object_type": "snmp.Trap", "community": "Community 2", "destination": "Destination 2", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5984,7 +5984,7 @@ func TestFlattenListSnmpTrap(t *testing.T) { func TestFlattenListSnmpUser(t *testing.T) { p := []models.SnmpUser{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","SecurityLevel":"SecurityLevel %d","PrivacyType":"PrivacyType %d","AuthType":"AuthType %d","ClassId":"snmp.User","ObjectType":"snmp.User","IsAuthPasswordSet":true,"IsPrivacyPasswordSet":true}` + c := `{"PrivacyType":"PrivacyType %d","Name":"Name %d","SecurityLevel":"SecurityLevel %d","IsPrivacyPasswordSet":true,"ObjectType":"snmp.User","ClassId":"snmp.User","IsAuthPasswordSet":true,"AuthType":"AuthType %d"}` //test when the response is empty ffOpEmpty := flattenListSnmpUser(p, d) @@ -5999,7 +5999,7 @@ func TestFlattenListSnmpUser(t *testing.T) { p = append(p, x) } ffOp := flattenListSnmpUser(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "security_level": "SecurityLevel 1", "privacy_type": "PrivacyType 1", "auth_type": "AuthType 1", "class_id": "snmp.User", "object_type": "snmp.User", "is_auth_password_set": true, "is_privacy_password_set": true}, {"name": "Name 2", "security_level": "SecurityLevel 2", "privacy_type": "PrivacyType 2", "auth_type": "AuthType 2", "class_id": "snmp.User", "object_type": "snmp.User", "is_auth_password_set": true, "is_privacy_password_set": true}} + expectedOp := []map[string]interface{}{{"privacy_type": "PrivacyType 1", "name": "Name 1", "security_level": "SecurityLevel 1", "is_privacy_password_set": true, "object_type": "snmp.User", "class_id": "snmp.User", "is_auth_password_set": true, "auth_type": "AuthType 1"}, {"privacy_type": "PrivacyType 2", "name": "Name 2", "security_level": "SecurityLevel 2", "is_privacy_password_set": true, "object_type": "snmp.User", "class_id": "snmp.User", "is_auth_password_set": true, "auth_type": "AuthType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6008,7 +6008,7 @@ func TestFlattenListSnmpUser(t *testing.T) { func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { p := []models.SoftwareHyperflexDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListSoftwareHyperflexDistributableRelationship(p, d) @@ -6023,7 +6023,7 @@ func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwareHyperflexDistributableRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6032,7 +6032,7 @@ func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { p := []models.SoftwareUcsdDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListSoftwareUcsdDistributableRelationship(p, d) @@ -6047,7 +6047,7 @@ func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwareUcsdDistributableRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6056,7 +6056,7 @@ func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { func TestFlattenListSoftwarerepositoryConstraintModels(t *testing.T) { p := []models.SoftwarerepositoryConstraintModels{} var d = &schema.ResourceData{} - c := `{"MinVersion":"MinVersion %d","Name":"Name %d","ObjectType":"softwarerepository.ConstraintModels","ClassId":"softwarerepository.ConstraintModels","PlatformRegex":"PlatformRegex %d"}` + c := `{"ObjectType":"softwarerepository.ConstraintModels","ClassId":"softwarerepository.ConstraintModels","MinVersion":"MinVersion %d","Name":"Name %d","PlatformRegex":"PlatformRegex %d"}` //test when the response is empty ffOpEmpty := flattenListSoftwarerepositoryConstraintModels(p, d) @@ -6071,7 +6071,7 @@ func TestFlattenListSoftwarerepositoryConstraintModels(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwarerepositoryConstraintModels(p, d) - expectedOp := []map[string]interface{}{{"min_version": "MinVersion 1", "name": "Name 1", "object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels", "platform_regex": "PlatformRegex 1"}, {"min_version": "MinVersion 2", "name": "Name 2", "object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels", "platform_regex": "PlatformRegex 2"}} + expectedOp := []map[string]interface{}{{"object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels", "min_version": "MinVersion 1", "name": "Name 1", "platform_regex": "PlatformRegex 1"}, {"object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels", "min_version": "MinVersion 2", "name": "Name 2", "platform_regex": "PlatformRegex 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6080,7 +6080,7 @@ func TestFlattenListSoftwarerepositoryConstraintModels(t *testing.T) { func TestFlattenListStorageBaseInitiator(t *testing.T) { p := []models.StorageBaseInitiator{} var d = &schema.ResourceData{} - c := `{"ObjectType":"storage.BaseInitiator","ClassId":"storage.BaseInitiator","Iqn":"Iqn %d","Name":"Name %d","Type":"Type %d","Wwn":"Wwn %d"}` + c := `{"Type":"Type %d","Wwn":"Wwn %d","ObjectType":"storage.BaseInitiator","ClassId":"storage.BaseInitiator","Iqn":"Iqn %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListStorageBaseInitiator(p, d) @@ -6095,7 +6095,7 @@ func TestFlattenListStorageBaseInitiator(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageBaseInitiator(p, d) - expectedOp := []map[string]interface{}{{"object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 1", "name": "Name 1", "type": "Type 1", "wwn": "Wwn 1"}, {"object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 2", "name": "Name 2", "type": "Type 2", "wwn": "Wwn 2"}} + expectedOp := []map[string]interface{}{{"type": "Type 1", "wwn": "Wwn 1", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 1", "name": "Name 1"}, {"type": "Type 2", "wwn": "Wwn 2", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6104,7 +6104,7 @@ func TestFlattenListStorageBaseInitiator(t *testing.T) { func TestFlattenListStorageControllerRelationship(t *testing.T) { p := []models.StorageControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageControllerRelationship(p, d) @@ -6119,7 +6119,7 @@ func TestFlattenListStorageControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6128,7 +6128,7 @@ func TestFlattenListStorageControllerRelationship(t *testing.T) { func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { p := []models.StorageDiskGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageDiskGroupRelationship(p, d) @@ -6143,7 +6143,7 @@ func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageDiskGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6152,7 +6152,7 @@ func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { func TestFlattenListStorageDiskSlotRelationship(t *testing.T) { p := []models.StorageDiskSlotRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageDiskSlotRelationship(p, d) @@ -6167,7 +6167,7 @@ func TestFlattenListStorageDiskSlotRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageDiskSlotRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6200,7 +6200,7 @@ func TestFlattenListStorageDriveGroupRelationship(t *testing.T) { func TestFlattenListStorageEnclosureRelationship(t *testing.T) { p := []models.StorageEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageEnclosureRelationship(p, d) @@ -6215,7 +6215,7 @@ func TestFlattenListStorageEnclosureRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageEnclosureRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6224,7 +6224,7 @@ func TestFlattenListStorageEnclosureRelationship(t *testing.T) { func TestFlattenListStorageEnclosureDiskRelationship(t *testing.T) { p := []models.StorageEnclosureDiskRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageEnclosureDiskRelationship(p, d) @@ -6239,7 +6239,7 @@ func TestFlattenListStorageEnclosureDiskRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageEnclosureDiskRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6248,7 +6248,7 @@ func TestFlattenListStorageEnclosureDiskRelationship(t *testing.T) { func TestFlattenListStorageEnclosureDiskSlotEpRelationship(t *testing.T) { p := []models.StorageEnclosureDiskSlotEpRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageEnclosureDiskSlotEpRelationship(p, d) @@ -6263,7 +6263,7 @@ func TestFlattenListStorageEnclosureDiskSlotEpRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageEnclosureDiskSlotEpRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6272,7 +6272,7 @@ func TestFlattenListStorageEnclosureDiskSlotEpRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { p := []models.StorageFlexFlashControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashControllerRelationship(p, d) @@ -6287,7 +6287,7 @@ func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6296,7 +6296,7 @@ func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { p := []models.StorageFlexFlashControllerPropsRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashControllerPropsRelationship(p, d) @@ -6311,7 +6311,7 @@ func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashControllerPropsRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6320,7 +6320,7 @@ func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashPhysicalDriveRelationship(t *testing.T) { p := []models.StorageFlexFlashPhysicalDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashPhysicalDriveRelationship(p, d) @@ -6335,7 +6335,7 @@ func TestFlattenListStorageFlexFlashPhysicalDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashPhysicalDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6368,7 +6368,7 @@ func TestFlattenListStorageFlexFlashVirtualDriveRelationship(t *testing.T) { func TestFlattenListStorageFlexUtilControllerRelationship(t *testing.T) { p := []models.StorageFlexUtilControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexUtilControllerRelationship(p, d) @@ -6383,7 +6383,7 @@ func TestFlattenListStorageFlexUtilControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexUtilControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6416,7 +6416,7 @@ func TestFlattenListStorageFlexUtilPhysicalDriveRelationship(t *testing.T) { func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { p := []models.StorageFlexUtilVirtualDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexUtilVirtualDriveRelationship(p, d) @@ -6431,7 +6431,7 @@ func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexUtilVirtualDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6440,7 +6440,7 @@ func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { p := []models.StorageHitachiParityGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageHitachiParityGroupRelationship(p, d) @@ -6455,7 +6455,7 @@ func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHitachiParityGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6464,7 +6464,7 @@ func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { p := []models.StorageHyperFlexStorageContainerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageHyperFlexStorageContainerRelationship(p, d) @@ -6479,7 +6479,7 @@ func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHyperFlexStorageContainerRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6488,7 +6488,7 @@ func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { func TestFlattenListStorageHyperFlexVolumeRelationship(t *testing.T) { p := []models.StorageHyperFlexVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageHyperFlexVolumeRelationship(p, d) @@ -6503,7 +6503,7 @@ func TestFlattenListStorageHyperFlexVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHyperFlexVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6536,7 +6536,7 @@ func TestFlattenListStorageItemRelationship(t *testing.T) { func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { p := []models.StorageNetAppAggregateRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppAggregateRelationship(p, d) @@ -6551,7 +6551,7 @@ func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppAggregateRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6560,7 +6560,7 @@ func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { func TestFlattenListStorageNetAppExportPolicyRule(t *testing.T) { p := []models.StorageNetAppExportPolicyRule{} var d = &schema.ResourceData{} - c := `{"Index":32,"ClassId":"storage.NetAppExportPolicyRule","User":"User %d","ObjectType":"storage.NetAppExportPolicyRule"}` + c := `{"User":"User %d","ClassId":"storage.NetAppExportPolicyRule","ObjectType":"storage.NetAppExportPolicyRule","Index":32}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppExportPolicyRule(p, d) @@ -6575,7 +6575,7 @@ func TestFlattenListStorageNetAppExportPolicyRule(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppExportPolicyRule(p, d) - expectedOp := []map[string]interface{}{{"index": 32, "class_id": "storage.NetAppExportPolicyRule", "user": "User 1", "object_type": "storage.NetAppExportPolicyRule"}, {"index": 32, "class_id": "storage.NetAppExportPolicyRule", "user": "User 2", "object_type": "storage.NetAppExportPolicyRule"}} + expectedOp := []map[string]interface{}{{"user": "User 1", "class_id": "storage.NetAppExportPolicyRule", "object_type": "storage.NetAppExportPolicyRule", "index": 32}, {"user": "User 2", "class_id": "storage.NetAppExportPolicyRule", "object_type": "storage.NetAppExportPolicyRule", "index": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6584,7 +6584,7 @@ func TestFlattenListStorageNetAppExportPolicyRule(t *testing.T) { func TestFlattenListStorageNetAppInitiatorGroupRelationship(t *testing.T) { p := []models.StorageNetAppInitiatorGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppInitiatorGroupRelationship(p, d) @@ -6599,7 +6599,7 @@ func TestFlattenListStorageNetAppInitiatorGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppInitiatorGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6608,7 +6608,7 @@ func TestFlattenListStorageNetAppInitiatorGroupRelationship(t *testing.T) { func TestFlattenListStoragePhysicalDiskRelationship(t *testing.T) { p := []models.StoragePhysicalDiskRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStoragePhysicalDiskRelationship(p, d) @@ -6623,7 +6623,7 @@ func TestFlattenListStoragePhysicalDiskRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePhysicalDiskRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6656,7 +6656,7 @@ func TestFlattenListStoragePhysicalDiskExtensionRelationship(t *testing.T) { func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { p := []models.StoragePhysicalDiskUsageRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePhysicalDiskUsageRelationship(p, d) @@ -6671,7 +6671,7 @@ func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePhysicalDiskUsageRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6680,7 +6680,7 @@ func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { func TestFlattenListStoragePureHostRelationship(t *testing.T) { p := []models.StoragePureHostRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureHostRelationship(p, d) @@ -6695,7 +6695,7 @@ func TestFlattenListStoragePureHostRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureHostRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6704,7 +6704,7 @@ func TestFlattenListStoragePureHostRelationship(t *testing.T) { func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { p := []models.StoragePureHostGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureHostGroupRelationship(p, d) @@ -6719,7 +6719,7 @@ func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureHostGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6728,7 +6728,7 @@ func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { p := []models.StoragePureReplicationBlackout{} var d = &schema.ResourceData{} - c := `{"ObjectType":"storage.PureReplicationBlackout","ClassId":"storage.PureReplicationBlackout","End":"End %d","Start":"Start %d"}` + c := `{"ClassId":"storage.PureReplicationBlackout","ObjectType":"storage.PureReplicationBlackout","End":"End %d","Start":"Start %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureReplicationBlackout(p, d) @@ -6743,7 +6743,7 @@ func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureReplicationBlackout(p, d) - expectedOp := []map[string]interface{}{{"object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 1", "start": "Start 1"}, {"object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 2", "start": "Start 2"}} + expectedOp := []map[string]interface{}{{"class_id": "storage.PureReplicationBlackout", "object_type": "storage.PureReplicationBlackout", "end": "End 1", "start": "Start 1"}, {"class_id": "storage.PureReplicationBlackout", "object_type": "storage.PureReplicationBlackout", "end": "End 2", "start": "Start 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6752,7 +6752,7 @@ func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { p := []models.StoragePureVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureVolumeRelationship(p, d) @@ -6767,7 +6767,7 @@ func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6776,7 +6776,7 @@ func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { func TestFlattenListStorageSasExpanderRelationship(t *testing.T) { p := []models.StorageSasExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageSasExpanderRelationship(p, d) @@ -6791,7 +6791,7 @@ func TestFlattenListStorageSasExpanderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageSasExpanderRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6824,7 +6824,7 @@ func TestFlattenListStorageSasPortRelationship(t *testing.T) { func TestFlattenListStorageSpanRelationship(t *testing.T) { p := []models.StorageSpanRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageSpanRelationship(p, d) @@ -6839,7 +6839,7 @@ func TestFlattenListStorageSpanRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageSpanRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6848,7 +6848,7 @@ func TestFlattenListStorageSpanRelationship(t *testing.T) { func TestFlattenListStorageVdMemberEpRelationship(t *testing.T) { p := []models.StorageVdMemberEpRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageVdMemberEpRelationship(p, d) @@ -6863,7 +6863,7 @@ func TestFlattenListStorageVdMemberEpRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVdMemberEpRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6896,7 +6896,7 @@ func TestFlattenListStorageVirtualDriveRelationship(t *testing.T) { func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { p := []models.StorageVirtualDriveConfiguration{} var d = &schema.ResourceData{} - c := `{"ExpandToAvailable":true,"Name":"Name %d","Size":32,"ClassId":"storage.VirtualDriveConfiguration","ObjectType":"storage.VirtualDriveConfiguration","BootDrive":true}` + c := `{"ClassId":"storage.VirtualDriveConfiguration","ObjectType":"storage.VirtualDriveConfiguration","BootDrive":true,"ExpandToAvailable":true,"Name":"Name %d","Size":32}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveConfiguration(p, d) @@ -6911,7 +6911,7 @@ func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveConfiguration(p, d) - expectedOp := []map[string]interface{}{{"expand_to_available": true, "name": "Name 1", "size": 32, "class_id": "storage.VirtualDriveConfiguration", "object_type": "storage.VirtualDriveConfiguration", "boot_drive": true}, {"expand_to_available": true, "name": "Name 2", "size": 32, "class_id": "storage.VirtualDriveConfiguration", "object_type": "storage.VirtualDriveConfiguration", "boot_drive": true}} + expectedOp := []map[string]interface{}{{"class_id": "storage.VirtualDriveConfiguration", "object_type": "storage.VirtualDriveConfiguration", "boot_drive": true, "expand_to_available": true, "name": "Name 1", "size": 32}, {"class_id": "storage.VirtualDriveConfiguration", "object_type": "storage.VirtualDriveConfiguration", "boot_drive": true, "expand_to_available": true, "name": "Name 2", "size": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6920,7 +6920,7 @@ func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { func TestFlattenListStorageVirtualDriveContainerRelationship(t *testing.T) { p := []models.StorageVirtualDriveContainerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveContainerRelationship(p, d) @@ -6935,7 +6935,7 @@ func TestFlattenListStorageVirtualDriveContainerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveContainerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6968,7 +6968,7 @@ func TestFlattenListStorageVirtualDriveExtensionRelationship(t *testing.T) { func TestFlattenListSyslogLocalClientBase(t *testing.T) { p := []models.SyslogLocalClientBase{} var d = &schema.ResourceData{} - c := `{"MinSeverity":"MinSeverity %d","ClassId":"syslog.LocalClientBase","ObjectType":"syslog.LocalClientBase"}` + c := `{"ObjectType":"syslog.LocalClientBase","ClassId":"syslog.LocalClientBase","MinSeverity":"MinSeverity %d"}` //test when the response is empty ffOpEmpty := flattenListSyslogLocalClientBase(p, d) @@ -6983,7 +6983,7 @@ func TestFlattenListSyslogLocalClientBase(t *testing.T) { p = append(p, x) } ffOp := flattenListSyslogLocalClientBase(p, d) - expectedOp := []map[string]interface{}{{"min_severity": "MinSeverity 1", "class_id": "syslog.LocalClientBase", "object_type": "syslog.LocalClientBase"}, {"min_severity": "MinSeverity 2", "class_id": "syslog.LocalClientBase", "object_type": "syslog.LocalClientBase"}} + expectedOp := []map[string]interface{}{{"object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase", "min_severity": "MinSeverity 1"}, {"object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase", "min_severity": "MinSeverity 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6992,7 +6992,7 @@ func TestFlattenListSyslogLocalClientBase(t *testing.T) { func TestFlattenListSyslogRemoteClientBase(t *testing.T) { p := []models.SyslogRemoteClientBase{} var d = &schema.ResourceData{} - c := `{"MinSeverity":"MinSeverity %d","ClassId":"syslog.RemoteClientBase","ObjectType":"syslog.RemoteClientBase","Port":32,"Protocol":"Protocol %d","Enabled":true,"Hostname":"Hostname %d"}` + c := `{"ObjectType":"syslog.RemoteClientBase","Enabled":true,"Hostname":"Hostname %d","MinSeverity":"MinSeverity %d","Port":32,"Protocol":"Protocol %d","ClassId":"syslog.RemoteClientBase"}` //test when the response is empty ffOpEmpty := flattenListSyslogRemoteClientBase(p, d) @@ -7007,7 +7007,7 @@ func TestFlattenListSyslogRemoteClientBase(t *testing.T) { p = append(p, x) } ffOp := flattenListSyslogRemoteClientBase(p, d) - expectedOp := []map[string]interface{}{{"min_severity": "MinSeverity 1", "class_id": "syslog.RemoteClientBase", "object_type": "syslog.RemoteClientBase", "port": 32, "protocol": "Protocol 1", "enabled": true, "hostname": "Hostname 1"}, {"min_severity": "MinSeverity 2", "class_id": "syslog.RemoteClientBase", "object_type": "syslog.RemoteClientBase", "port": 32, "protocol": "Protocol 2", "enabled": true, "hostname": "Hostname 2"}} + expectedOp := []map[string]interface{}{{"object_type": "syslog.RemoteClientBase", "enabled": true, "hostname": "Hostname 1", "min_severity": "MinSeverity 1", "port": 32, "protocol": "Protocol 1", "class_id": "syslog.RemoteClientBase"}, {"object_type": "syslog.RemoteClientBase", "enabled": true, "hostname": "Hostname 2", "min_severity": "MinSeverity 2", "port": 32, "protocol": "Protocol 2", "class_id": "syslog.RemoteClientBase"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7016,7 +7016,7 @@ func TestFlattenListSyslogRemoteClientBase(t *testing.T) { func TestFlattenListTamAction(t *testing.T) { p := []models.TamAction{} var d = &schema.ResourceData{} - c := `{"ObjectType":"tam.Action","AffectedObjectType":"AffectedObjectType %d","Type":"Type %d","OperationType":"OperationType %d","AlertType":"AlertType %d","ClassId":"tam.Action","Name":"Name %d"}` + c := `{"AlertType":"AlertType %d","AffectedObjectType":"AffectedObjectType %d","Name":"Name %d","OperationType":"OperationType %d","ClassId":"tam.Action","ObjectType":"tam.Action","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListTamAction(p, d) @@ -7031,7 +7031,7 @@ func TestFlattenListTamAction(t *testing.T) { p = append(p, x) } ffOp := flattenListTamAction(p, d) - expectedOp := []map[string]interface{}{{"object_type": "tam.Action", "affected_object_type": "AffectedObjectType 1", "type": "Type 1", "operation_type": "OperationType 1", "alert_type": "AlertType 1", "class_id": "tam.Action", "name": "Name 1"}, {"object_type": "tam.Action", "affected_object_type": "AffectedObjectType 2", "type": "Type 2", "operation_type": "OperationType 2", "alert_type": "AlertType 2", "class_id": "tam.Action", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"alert_type": "AlertType 1", "affected_object_type": "AffectedObjectType 1", "name": "Name 1", "operation_type": "OperationType 1", "class_id": "tam.Action", "object_type": "tam.Action", "type": "Type 1"}, {"alert_type": "AlertType 2", "affected_object_type": "AffectedObjectType 2", "name": "Name 2", "operation_type": "OperationType 2", "class_id": "tam.Action", "object_type": "tam.Action", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7040,7 +7040,7 @@ func TestFlattenListTamAction(t *testing.T) { func TestFlattenListTamApiDataSource(t *testing.T) { p := []models.TamApiDataSource{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ClassId":"tam.ApiDataSource","MoType":"MoType %d","ObjectType":"tam.ApiDataSource","Type":"Type %d"}` + c := `{"Name":"Name %d","MoType":"MoType %d","Type":"Type %d","ClassId":"tam.ApiDataSource","ObjectType":"tam.ApiDataSource"}` //test when the response is empty ffOpEmpty := flattenListTamApiDataSource(p, d) @@ -7055,7 +7055,7 @@ func TestFlattenListTamApiDataSource(t *testing.T) { p = append(p, x) } ffOp := flattenListTamApiDataSource(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "class_id": "tam.ApiDataSource", "mo_type": "MoType 1", "object_type": "tam.ApiDataSource", "type": "Type 1"}, {"name": "Name 2", "class_id": "tam.ApiDataSource", "mo_type": "MoType 2", "object_type": "tam.ApiDataSource", "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "mo_type": "MoType 1", "type": "Type 1", "class_id": "tam.ApiDataSource", "object_type": "tam.ApiDataSource"}, {"name": "Name 2", "mo_type": "MoType 2", "type": "Type 2", "class_id": "tam.ApiDataSource", "object_type": "tam.ApiDataSource"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7064,7 +7064,7 @@ func TestFlattenListTamApiDataSource(t *testing.T) { func TestFlattenListTamS3DataSource(t *testing.T) { p := []models.TamS3DataSource{} var d = &schema.ResourceData{} - c := `{"ClassId":"tam.S3DataSource","S3Path":"S3Path %d","ObjectType":"tam.S3DataSource","Type":"Type %d","Name":"Name %d"}` + c := `{"Type":"Type %d","S3Path":"S3Path %d","ClassId":"tam.S3DataSource","ObjectType":"tam.S3DataSource","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListTamS3DataSource(p, d) @@ -7079,7 +7079,7 @@ func TestFlattenListTamS3DataSource(t *testing.T) { p = append(p, x) } ffOp := flattenListTamS3DataSource(p, d) - expectedOp := []map[string]interface{}{{"class_id": "tam.S3DataSource", "s3_path": "S3Path 1", "object_type": "tam.S3DataSource", "type": "Type 1", "name": "Name 1"}, {"class_id": "tam.S3DataSource", "s3_path": "S3Path 2", "object_type": "tam.S3DataSource", "type": "Type 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"type": "Type 1", "s3_path": "S3Path 1", "class_id": "tam.S3DataSource", "object_type": "tam.S3DataSource", "name": "Name 1"}, {"type": "Type 2", "s3_path": "S3Path 2", "class_id": "tam.S3DataSource", "object_type": "tam.S3DataSource", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7088,7 +7088,7 @@ func TestFlattenListTamS3DataSource(t *testing.T) { func TestFlattenListUcsdConnectorPack(t *testing.T) { p := []models.UcsdConnectorPack{} var d = &schema.ResourceData{} - c := `{"State":"State %d","Name":"Name %d","ClassId":"ucsd.ConnectorPack","ObjectType":"ucsd.ConnectorPack","DownloadedVersion":"DownloadedVersion %d","Version":"Version %d","ConnectorFeature":"ConnectorFeature %d"}` + c := `{"Name":"Name %d","State":"State %d","ClassId":"ucsd.ConnectorPack","ConnectorFeature":"ConnectorFeature %d","DownloadedVersion":"DownloadedVersion %d","ObjectType":"ucsd.ConnectorPack","Version":"Version %d"}` //test when the response is empty ffOpEmpty := flattenListUcsdConnectorPack(p, d) @@ -7103,7 +7103,7 @@ func TestFlattenListUcsdConnectorPack(t *testing.T) { p = append(p, x) } ffOp := flattenListUcsdConnectorPack(p, d) - expectedOp := []map[string]interface{}{{"state": "State 1", "name": "Name 1", "class_id": "ucsd.ConnectorPack", "object_type": "ucsd.ConnectorPack", "downloaded_version": "DownloadedVersion 1", "nr_version": "Version 1", "connector_feature": "ConnectorFeature 1"}, {"state": "State 2", "name": "Name 2", "class_id": "ucsd.ConnectorPack", "object_type": "ucsd.ConnectorPack", "downloaded_version": "DownloadedVersion 2", "nr_version": "Version 2", "connector_feature": "ConnectorFeature 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "state": "State 1", "class_id": "ucsd.ConnectorPack", "connector_feature": "ConnectorFeature 1", "downloaded_version": "DownloadedVersion 1", "object_type": "ucsd.ConnectorPack", "nr_version": "Version 1"}, {"name": "Name 2", "state": "State 2", "class_id": "ucsd.ConnectorPack", "connector_feature": "ConnectorFeature 2", "downloaded_version": "DownloadedVersion 2", "object_type": "ucsd.ConnectorPack", "nr_version": "Version 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7112,7 +7112,7 @@ func TestFlattenListUcsdConnectorPack(t *testing.T) { func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { p := []models.UuidpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListUuidpoolBlockRelationship(p, d) @@ -7127,7 +7127,7 @@ func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListUuidpoolBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7136,7 +7136,7 @@ func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { func TestFlattenListUuidpoolUuidBlock(t *testing.T) { p := []models.UuidpoolUuidBlock{} var d = &schema.ResourceData{} - c := `{"Size":32,"ClassId":"uuidpool.UuidBlock","To":"To %d","From":"From %d","ObjectType":"uuidpool.UuidBlock"}` + c := `{"ObjectType":"uuidpool.UuidBlock","To":"To %d","From":"From %d","Size":32,"ClassId":"uuidpool.UuidBlock"}` //test when the response is empty ffOpEmpty := flattenListUuidpoolUuidBlock(p, d) @@ -7151,7 +7151,7 @@ func TestFlattenListUuidpoolUuidBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListUuidpoolUuidBlock(p, d) - expectedOp := []map[string]interface{}{{"size": 32, "class_id": "uuidpool.UuidBlock", "to": "To 1", "from": "From 1", "object_type": "uuidpool.UuidBlock"}, {"size": 32, "class_id": "uuidpool.UuidBlock", "to": "To 2", "from": "From 2", "object_type": "uuidpool.UuidBlock"}} + expectedOp := []map[string]interface{}{{"object_type": "uuidpool.UuidBlock", "to": "To 1", "from": "From 1", "size": 32, "class_id": "uuidpool.UuidBlock"}, {"object_type": "uuidpool.UuidBlock", "to": "To 2", "from": "From 2", "size": 32, "class_id": "uuidpool.UuidBlock"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7160,7 +7160,7 @@ func TestFlattenListUuidpoolUuidBlock(t *testing.T) { func TestFlattenListVirtualizationBaseNetworkRelationship(t *testing.T) { p := []models.VirtualizationBaseNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationBaseNetworkRelationship(p, d) @@ -7175,7 +7175,7 @@ func TestFlattenListVirtualizationBaseNetworkRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationBaseNetworkRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7184,7 +7184,7 @@ func TestFlattenListVirtualizationBaseNetworkRelationship(t *testing.T) { func TestFlattenListVirtualizationNetworkInterface(t *testing.T) { p := []models.VirtualizationNetworkInterface{} var d = &schema.ResourceData{} - c := `{"ConnectAtPowerOn":true,"DirectPathIo":true,"ClassId":"virtualization.NetworkInterface","Name":"Name %d","AdaptorType":"AdaptorType %d","Bridge":"Bridge %d","ObjectType":"virtualization.NetworkInterface","MacAddress":"MacAddress %d"}` + c := `{"Name":"Name %d","ClassId":"virtualization.NetworkInterface","AdaptorType":"AdaptorType %d","Bridge":"Bridge %d","ConnectAtPowerOn":true,"DirectPathIo":true,"MacAddress":"MacAddress %d","ObjectType":"virtualization.NetworkInterface"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationNetworkInterface(p, d) @@ -7199,7 +7199,7 @@ func TestFlattenListVirtualizationNetworkInterface(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationNetworkInterface(p, d) - expectedOp := []map[string]interface{}{{"connect_at_power_on": true, "direct_path_io": true, "class_id": "virtualization.NetworkInterface", "name": "Name 1", "adaptor_type": "AdaptorType 1", "bridge": "Bridge 1", "object_type": "virtualization.NetworkInterface", "mac_address": "MacAddress 1"}, {"connect_at_power_on": true, "direct_path_io": true, "class_id": "virtualization.NetworkInterface", "name": "Name 2", "adaptor_type": "AdaptorType 2", "bridge": "Bridge 2", "object_type": "virtualization.NetworkInterface", "mac_address": "MacAddress 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "class_id": "virtualization.NetworkInterface", "adaptor_type": "AdaptorType 1", "bridge": "Bridge 1", "connect_at_power_on": true, "direct_path_io": true, "mac_address": "MacAddress 1", "object_type": "virtualization.NetworkInterface"}, {"name": "Name 2", "class_id": "virtualization.NetworkInterface", "adaptor_type": "AdaptorType 2", "bridge": "Bridge 2", "connect_at_power_on": true, "direct_path_io": true, "mac_address": "MacAddress 2", "object_type": "virtualization.NetworkInterface"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7208,7 +7208,7 @@ func TestFlattenListVirtualizationNetworkInterface(t *testing.T) { func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { p := []models.VirtualizationVirtualMachineDisk{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Type":"Type %d","VirtualDiskReference":"VirtualDiskReference %d","ClassId":"virtualization.VirtualMachineDisk","ObjectType":"virtualization.VirtualMachineDisk","Bus":"Bus %d","Order":32}` + c := `{"Order":32,"Type":"Type %d","ClassId":"virtualization.VirtualMachineDisk","ObjectType":"virtualization.VirtualMachineDisk","Bus":"Bus %d","Name":"Name %d","VirtualDiskReference":"VirtualDiskReference %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVirtualMachineDisk(p, d) @@ -7223,7 +7223,7 @@ func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVirtualMachineDisk(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "type": "Type 1", "virtual_disk_reference": "VirtualDiskReference 1", "class_id": "virtualization.VirtualMachineDisk", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 1", "order": 32}, {"name": "Name 2", "type": "Type 2", "virtual_disk_reference": "VirtualDiskReference 2", "class_id": "virtualization.VirtualMachineDisk", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 2", "order": 32}} + expectedOp := []map[string]interface{}{{"order": 32, "type": "Type 1", "class_id": "virtualization.VirtualMachineDisk", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 1", "name": "Name 1", "virtual_disk_reference": "VirtualDiskReference 1"}, {"order": 32, "type": "Type 2", "class_id": "virtualization.VirtualMachineDisk", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 2", "name": "Name 2", "virtual_disk_reference": "VirtualDiskReference 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7232,7 +7232,7 @@ func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { p := []models.VirtualizationVmwareDatastoreRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareDatastoreRelationship(p, d) @@ -7247,7 +7247,7 @@ func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareDatastoreRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7256,7 +7256,7 @@ func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { func TestFlattenListVirtualizationVmwareDistributedNetworkRelationship(t *testing.T) { p := []models.VirtualizationVmwareDistributedNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareDistributedNetworkRelationship(p, d) @@ -7271,7 +7271,7 @@ func TestFlattenListVirtualizationVmwareDistributedNetworkRelationship(t *testin p = append(p, x) } ffOp := flattenListVirtualizationVmwareDistributedNetworkRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7304,7 +7304,7 @@ func TestFlattenListVirtualizationVmwareDistributedSwitchRelationship(t *testing func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { p := []models.VirtualizationVmwareHostRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareHostRelationship(p, d) @@ -7319,7 +7319,7 @@ func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareHostRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7328,7 +7328,7 @@ func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { p := []models.VirtualizationVmwareVlanRange{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareVlanRange","ObjectType":"virtualization.VmwareVlanRange","VlanRangeEnd":32,"VlanRangeStart":32}` + c := `{"VlanRangeStart":32,"ClassId":"virtualization.VmwareVlanRange","ObjectType":"virtualization.VmwareVlanRange","VlanRangeEnd":32}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareVlanRange(p, d) @@ -7343,7 +7343,7 @@ func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareVlanRange(p, d) - expectedOp := []map[string]interface{}{{"class_id": "virtualization.VmwareVlanRange", "object_type": "virtualization.VmwareVlanRange", "vlan_range_end": 32, "vlan_range_start": 32}, {"class_id": "virtualization.VmwareVlanRange", "object_type": "virtualization.VmwareVlanRange", "vlan_range_end": 32, "vlan_range_start": 32}} + expectedOp := []map[string]interface{}{{"vlan_range_start": 32, "class_id": "virtualization.VmwareVlanRange", "object_type": "virtualization.VmwareVlanRange", "vlan_range_end": 32}, {"vlan_range_start": 32, "class_id": "virtualization.VmwareVlanRange", "object_type": "virtualization.VmwareVlanRange", "vlan_range_end": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7352,7 +7352,7 @@ func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { func TestFlattenListVmediaMapping(t *testing.T) { p := []models.VmediaMapping{} var d = &schema.ResourceData{} - c := `{"ClassId":"vmedia.Mapping","IsPasswordSet":true,"MountOptions":"MountOptions %d","AuthenticationProtocol":"AuthenticationProtocol %d","VolumeName":"VolumeName %d","FileLocation":"FileLocation %d","ObjectType":"vmedia.Mapping","HostName":"HostName %d","RemoteFile":"RemoteFile %d","MountProtocol":"MountProtocol %d","DeviceType":"DeviceType %d","RemotePath":"RemotePath %d","Username":"Username %d","SanitizedFileLocation":"SanitizedFileLocation %d"}` + c := `{"ClassId":"vmedia.Mapping","FileLocation":"FileLocation %d","AuthenticationProtocol":"AuthenticationProtocol %d","VolumeName":"VolumeName %d","SanitizedFileLocation":"SanitizedFileLocation %d","RemoteFile":"RemoteFile %d","MountOptions":"MountOptions %d","MountProtocol":"MountProtocol %d","HostName":"HostName %d","IsPasswordSet":true,"ObjectType":"vmedia.Mapping","Username":"Username %d","DeviceType":"DeviceType %d","RemotePath":"RemotePath %d"}` //test when the response is empty ffOpEmpty := flattenListVmediaMapping(p, d) @@ -7367,7 +7367,7 @@ func TestFlattenListVmediaMapping(t *testing.T) { p = append(p, x) } ffOp := flattenListVmediaMapping(p, d) - expectedOp := []map[string]interface{}{{"class_id": "vmedia.Mapping", "is_password_set": true, "mount_options": "MountOptions 1", "authentication_protocol": "AuthenticationProtocol 1", "volume_name": "VolumeName 1", "file_location": "FileLocation 1", "object_type": "vmedia.Mapping", "host_name": "HostName 1", "remote_file": "RemoteFile 1", "mount_protocol": "MountProtocol 1", "device_type": "DeviceType 1", "remote_path": "RemotePath 1", "username": "Username 1", "sanitized_file_location": "SanitizedFileLocation 1"}, {"class_id": "vmedia.Mapping", "is_password_set": true, "mount_options": "MountOptions 2", "authentication_protocol": "AuthenticationProtocol 2", "volume_name": "VolumeName 2", "file_location": "FileLocation 2", "object_type": "vmedia.Mapping", "host_name": "HostName 2", "remote_file": "RemoteFile 2", "mount_protocol": "MountProtocol 2", "device_type": "DeviceType 2", "remote_path": "RemotePath 2", "username": "Username 2", "sanitized_file_location": "SanitizedFileLocation 2"}} + expectedOp := []map[string]interface{}{{"class_id": "vmedia.Mapping", "file_location": "FileLocation 1", "authentication_protocol": "AuthenticationProtocol 1", "volume_name": "VolumeName 1", "sanitized_file_location": "SanitizedFileLocation 1", "remote_file": "RemoteFile 1", "mount_options": "MountOptions 1", "mount_protocol": "MountProtocol 1", "host_name": "HostName 1", "is_password_set": true, "object_type": "vmedia.Mapping", "username": "Username 1", "device_type": "DeviceType 1", "remote_path": "RemotePath 1"}, {"class_id": "vmedia.Mapping", "file_location": "FileLocation 2", "authentication_protocol": "AuthenticationProtocol 2", "volume_name": "VolumeName 2", "sanitized_file_location": "SanitizedFileLocation 2", "remote_file": "RemoteFile 2", "mount_options": "MountOptions 2", "mount_protocol": "MountProtocol 2", "host_name": "HostName 2", "is_password_set": true, "object_type": "vmedia.Mapping", "username": "Username 2", "device_type": "DeviceType 2", "remote_path": "RemotePath 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7376,7 +7376,7 @@ func TestFlattenListVmediaMapping(t *testing.T) { func TestFlattenListVnicEthIfRelationship(t *testing.T) { p := []models.VnicEthIfRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListVnicEthIfRelationship(p, d) @@ -7391,7 +7391,7 @@ func TestFlattenListVnicEthIfRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicEthIfRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7400,7 +7400,7 @@ func TestFlattenListVnicEthIfRelationship(t *testing.T) { func TestFlattenListVnicEthNetworkPolicyRelationship(t *testing.T) { p := []models.VnicEthNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVnicEthNetworkPolicyRelationship(p, d) @@ -7415,7 +7415,7 @@ func TestFlattenListVnicEthNetworkPolicyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicEthNetworkPolicyRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7424,7 +7424,7 @@ func TestFlattenListVnicEthNetworkPolicyRelationship(t *testing.T) { func TestFlattenListVnicFcIfRelationship(t *testing.T) { p := []models.VnicFcIfRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVnicFcIfRelationship(p, d) @@ -7439,7 +7439,7 @@ func TestFlattenListVnicFcIfRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicFcIfRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7448,7 +7448,7 @@ func TestFlattenListVnicFcIfRelationship(t *testing.T) { func TestFlattenListVnicVifStatus(t *testing.T) { p := []models.VnicVifStatus{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.VifStatus","ObjectType":"vnic.VifStatus","Status":"Status %d","Name":"Name %d","Reason":"Reason %d"}` + c := `{"Status":"Status %d","Name":"Name %d","ObjectType":"vnic.VifStatus","ClassId":"vnic.VifStatus","Reason":"Reason %d"}` //test when the response is empty ffOpEmpty := flattenListVnicVifStatus(p, d) @@ -7463,7 +7463,7 @@ func TestFlattenListVnicVifStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicVifStatus(p, d) - expectedOp := []map[string]interface{}{{"class_id": "vnic.VifStatus", "object_type": "vnic.VifStatus", "status": "Status 1", "name": "Name 1", "reason": "Reason 1"}, {"class_id": "vnic.VifStatus", "object_type": "vnic.VifStatus", "status": "Status 2", "name": "Name 2", "reason": "Reason 2"}} + expectedOp := []map[string]interface{}{{"status": "Status 1", "name": "Name 1", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus", "reason": "Reason 1"}, {"status": "Status 2", "name": "Name 2", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus", "reason": "Reason 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7472,7 +7472,7 @@ func TestFlattenListVnicVifStatus(t *testing.T) { func TestFlattenListWorkflowApi(t *testing.T) { p := []models.WorkflowApi{} var d = &schema.ResourceData{} - c := `{"ErrorContentType":"ErrorContentType %d","StartDelay":32,"ClassId":"workflow.Api","Description":"Description %d","ObjectType":"workflow.Api","AssetTargetMoid":"AssetTargetMoid %d","Body":"Body %d","ContentType":"ContentType %d","Timeout":32,"Label":"Label %d","SkipOnCondition":"SkipOnCondition %d","Name":"Name %d"}` + c := `{"Body":"Body %d","SkipOnCondition":"SkipOnCondition %d","Label":"Label %d","ErrorContentType":"ErrorContentType %d","StartDelay":32,"ClassId":"workflow.Api","ContentType":"ContentType %d","Description":"Description %d","Name":"Name %d","Timeout":32,"ObjectType":"workflow.Api","AssetTargetMoid":"AssetTargetMoid %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowApi(p, d) @@ -7487,7 +7487,7 @@ func TestFlattenListWorkflowApi(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowApi(p, d) - expectedOp := []map[string]interface{}{{"error_content_type": "ErrorContentType 1", "start_delay": 32, "class_id": "workflow.Api", "description": "Description 1", "object_type": "workflow.Api", "asset_target_moid": "AssetTargetMoid 1", "body": "Body 1", "content_type": "ContentType 1", "timeout": 32, "label": "Label 1", "skip_on_condition": "SkipOnCondition 1", "name": "Name 1"}, {"error_content_type": "ErrorContentType 2", "start_delay": 32, "class_id": "workflow.Api", "description": "Description 2", "object_type": "workflow.Api", "asset_target_moid": "AssetTargetMoid 2", "body": "Body 2", "content_type": "ContentType 2", "timeout": 32, "label": "Label 2", "skip_on_condition": "SkipOnCondition 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"body": "Body 1", "skip_on_condition": "SkipOnCondition 1", "label": "Label 1", "error_content_type": "ErrorContentType 1", "start_delay": 32, "class_id": "workflow.Api", "content_type": "ContentType 1", "description": "Description 1", "name": "Name 1", "timeout": 32, "object_type": "workflow.Api", "asset_target_moid": "AssetTargetMoid 1"}, {"body": "Body 2", "skip_on_condition": "SkipOnCondition 2", "label": "Label 2", "error_content_type": "ErrorContentType 2", "start_delay": 32, "class_id": "workflow.Api", "content_type": "ContentType 2", "description": "Description 2", "name": "Name 2", "timeout": 32, "object_type": "workflow.Api", "asset_target_moid": "AssetTargetMoid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7496,7 +7496,7 @@ func TestFlattenListWorkflowApi(t *testing.T) { func TestFlattenListWorkflowBaseDataType(t *testing.T) { p := []models.WorkflowBaseDataType{} var d = &schema.ResourceData{} - c := `{"ClassId":"workflow.BaseDataType","Description":"Description %d","Label":"Label %d","Name":"Name %d","ObjectType":"workflow.BaseDataType","Required":true}` + c := `{"ClassId":"workflow.BaseDataType","ObjectType":"workflow.BaseDataType","Label":"Label %d","Required":true,"Name":"Name %d","Description":"Description %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowBaseDataType(p, d) @@ -7511,7 +7511,7 @@ func TestFlattenListWorkflowBaseDataType(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowBaseDataType(p, d) - expectedOp := []map[string]interface{}{{"class_id": "workflow.BaseDataType", "description": "Description 1", "label": "Label 1", "name": "Name 1", "object_type": "workflow.BaseDataType", "required": true}, {"class_id": "workflow.BaseDataType", "description": "Description 2", "label": "Label 2", "name": "Name 2", "object_type": "workflow.BaseDataType", "required": true}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.BaseDataType", "object_type": "workflow.BaseDataType", "label": "Label 1", "required": true, "name": "Name 1", "description": "Description 1"}, {"class_id": "workflow.BaseDataType", "object_type": "workflow.BaseDataType", "label": "Label 2", "required": true, "name": "Name 2", "description": "Description 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7568,7 +7568,7 @@ func TestFlattenListWorkflowMessage(t *testing.T) { func TestFlattenListWorkflowParameterSet(t *testing.T) { p := []models.WorkflowParameterSet{} var d = &schema.ResourceData{} - c := `{"ControlParameter":"ControlParameter %d","Name":"Name %d","ClassId":"workflow.ParameterSet","ObjectType":"workflow.ParameterSet","Value":"Value %d","Condition":"Condition %d"}` + c := `{"ClassId":"workflow.ParameterSet","ObjectType":"workflow.ParameterSet","Name":"Name %d","Value":"Value %d","Condition":"Condition %d","ControlParameter":"ControlParameter %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowParameterSet(p, d) @@ -7583,7 +7583,7 @@ func TestFlattenListWorkflowParameterSet(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowParameterSet(p, d) - expectedOp := []map[string]interface{}{{"control_parameter": "ControlParameter 1", "name": "Name 1", "class_id": "workflow.ParameterSet", "object_type": "workflow.ParameterSet", "value": "Value 1", "condition": "Condition 1"}, {"control_parameter": "ControlParameter 2", "name": "Name 2", "class_id": "workflow.ParameterSet", "object_type": "workflow.ParameterSet", "value": "Value 2", "condition": "Condition 2"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.ParameterSet", "object_type": "workflow.ParameterSet", "name": "Name 1", "value": "Value 1", "condition": "Condition 1", "control_parameter": "ControlParameter 1"}, {"class_id": "workflow.ParameterSet", "object_type": "workflow.ParameterSet", "name": "Name 2", "value": "Value 2", "condition": "Condition 2", "control_parameter": "ControlParameter 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7592,7 +7592,7 @@ func TestFlattenListWorkflowParameterSet(t *testing.T) { func TestFlattenListWorkflowRollbackTask(t *testing.T) { p := []models.WorkflowRollbackTask{} var d = &schema.ResourceData{} - c := `{"CatalogMoid":"CatalogMoid %d","TaskMoid":"TaskMoid %d","Version":32,"ClassId":"workflow.RollbackTask","ObjectType":"workflow.RollbackTask","Name":"Name %d","Description":"Description %d"}` + c := `{"ObjectType":"workflow.RollbackTask","Description":"Description %d","Name":"Name %d","Version":32,"ClassId":"workflow.RollbackTask","CatalogMoid":"CatalogMoid %d","TaskMoid":"TaskMoid %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowRollbackTask(p, d) @@ -7607,7 +7607,7 @@ func TestFlattenListWorkflowRollbackTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowRollbackTask(p, d) - expectedOp := []map[string]interface{}{{"catalog_moid": "CatalogMoid 1", "task_moid": "TaskMoid 1", "nr_version": 32, "class_id": "workflow.RollbackTask", "object_type": "workflow.RollbackTask", "name": "Name 1", "description": "Description 1"}, {"catalog_moid": "CatalogMoid 2", "task_moid": "TaskMoid 2", "nr_version": 32, "class_id": "workflow.RollbackTask", "object_type": "workflow.RollbackTask", "name": "Name 2", "description": "Description 2"}} + expectedOp := []map[string]interface{}{{"object_type": "workflow.RollbackTask", "description": "Description 1", "name": "Name 1", "nr_version": 32, "class_id": "workflow.RollbackTask", "catalog_moid": "CatalogMoid 1", "task_moid": "TaskMoid 1"}, {"object_type": "workflow.RollbackTask", "description": "Description 2", "name": "Name 2", "nr_version": 32, "class_id": "workflow.RollbackTask", "catalog_moid": "CatalogMoid 2", "task_moid": "TaskMoid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7616,7 +7616,7 @@ func TestFlattenListWorkflowRollbackTask(t *testing.T) { func TestFlattenListWorkflowRollbackWorkflowTask(t *testing.T) { p := []models.WorkflowRollbackWorkflowTask{} var d = &schema.ResourceData{} - c := `{"ClassId":"workflow.RollbackWorkflowTask","RollbackTaskName":"RollbackTaskName %d","Name":"Name %d","RefName":"RefName %d","TaskInfoMoid":"TaskInfoMoid %d","ObjectType":"workflow.RollbackWorkflowTask","TaskPath":"TaskPath %d","Status":"Status %d","Description":"Description %d","RollbackCompleted":true}` + c := `{"ClassId":"workflow.RollbackWorkflowTask","RollbackCompleted":true,"TaskInfoMoid":"TaskInfoMoid %d","Name":"Name %d","ObjectType":"workflow.RollbackWorkflowTask","RefName":"RefName %d","Status":"Status %d","TaskPath":"TaskPath %d","Description":"Description %d","RollbackTaskName":"RollbackTaskName %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowRollbackWorkflowTask(p, d) @@ -7631,7 +7631,7 @@ func TestFlattenListWorkflowRollbackWorkflowTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowRollbackWorkflowTask(p, d) - expectedOp := []map[string]interface{}{{"class_id": "workflow.RollbackWorkflowTask", "rollback_task_name": "RollbackTaskName 1", "name": "Name 1", "ref_name": "RefName 1", "task_info_moid": "TaskInfoMoid 1", "object_type": "workflow.RollbackWorkflowTask", "task_path": "TaskPath 1", "status": "Status 1", "description": "Description 1", "rollback_completed": true}, {"class_id": "workflow.RollbackWorkflowTask", "rollback_task_name": "RollbackTaskName 2", "name": "Name 2", "ref_name": "RefName 2", "task_info_moid": "TaskInfoMoid 2", "object_type": "workflow.RollbackWorkflowTask", "task_path": "TaskPath 2", "status": "Status 2", "description": "Description 2", "rollback_completed": true}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.RollbackWorkflowTask", "rollback_completed": true, "task_info_moid": "TaskInfoMoid 1", "name": "Name 1", "object_type": "workflow.RollbackWorkflowTask", "ref_name": "RefName 1", "status": "Status 1", "task_path": "TaskPath 1", "description": "Description 1", "rollback_task_name": "RollbackTaskName 1"}, {"class_id": "workflow.RollbackWorkflowTask", "rollback_completed": true, "task_info_moid": "TaskInfoMoid 2", "name": "Name 2", "object_type": "workflow.RollbackWorkflowTask", "ref_name": "RefName 2", "status": "Status 2", "task_path": "TaskPath 2", "description": "Description 2", "rollback_task_name": "RollbackTaskName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7664,7 +7664,7 @@ func TestFlattenListWorkflowTaskDefinitionRelationship(t *testing.T) { func TestFlattenListWorkflowTaskInfoRelationship(t *testing.T) { p := []models.WorkflowTaskInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowTaskInfoRelationship(p, d) @@ -7679,7 +7679,7 @@ func TestFlattenListWorkflowTaskInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowTaskInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7688,7 +7688,7 @@ func TestFlattenListWorkflowTaskInfoRelationship(t *testing.T) { func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { p := []models.WorkflowTaskRetryInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.TaskRetryInfo","Status":"Status %d","TaskInstId":"TaskInstId %d","ClassId":"workflow.TaskRetryInfo"}` + c := `{"ClassId":"workflow.TaskRetryInfo","ObjectType":"workflow.TaskRetryInfo","Status":"Status %d","TaskInstId":"TaskInstId %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowTaskRetryInfo(p, d) @@ -7703,7 +7703,7 @@ func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowTaskRetryInfo(p, d) - expectedOp := []map[string]interface{}{{"object_type": "workflow.TaskRetryInfo", "status": "Status 1", "task_inst_id": "TaskInstId 1", "class_id": "workflow.TaskRetryInfo"}, {"object_type": "workflow.TaskRetryInfo", "status": "Status 2", "task_inst_id": "TaskInstId 2", "class_id": "workflow.TaskRetryInfo"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.TaskRetryInfo", "object_type": "workflow.TaskRetryInfo", "status": "Status 1", "task_inst_id": "TaskInstId 1"}, {"class_id": "workflow.TaskRetryInfo", "object_type": "workflow.TaskRetryInfo", "status": "Status 2", "task_inst_id": "TaskInstId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7712,7 +7712,7 @@ func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { func TestFlattenListWorkflowUiInputFilter(t *testing.T) { p := []models.WorkflowUiInputFilter{} var d = &schema.ResourceData{} - c := `{"UserHelpMessage":"UserHelpMessage %d","ClassId":"workflow.UiInputFilter","ObjectType":"workflow.UiInputFilter","Name":"Name %d"}` + c := `{"ObjectType":"workflow.UiInputFilter","Name":"Name %d","UserHelpMessage":"UserHelpMessage %d","ClassId":"workflow.UiInputFilter"}` //test when the response is empty ffOpEmpty := flattenListWorkflowUiInputFilter(p, d) @@ -7727,7 +7727,7 @@ func TestFlattenListWorkflowUiInputFilter(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowUiInputFilter(p, d) - expectedOp := []map[string]interface{}{{"user_help_message": "UserHelpMessage 1", "class_id": "workflow.UiInputFilter", "object_type": "workflow.UiInputFilter", "name": "Name 1"}, {"user_help_message": "UserHelpMessage 2", "class_id": "workflow.UiInputFilter", "object_type": "workflow.UiInputFilter", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "workflow.UiInputFilter", "name": "Name 1", "user_help_message": "UserHelpMessage 1", "class_id": "workflow.UiInputFilter"}, {"object_type": "workflow.UiInputFilter", "name": "Name 2", "user_help_message": "UserHelpMessage 2", "class_id": "workflow.UiInputFilter"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7736,7 +7736,7 @@ func TestFlattenListWorkflowUiInputFilter(t *testing.T) { func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { p := []models.WorkflowWorkflowInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowWorkflowInfoRelationship(p, d) @@ -7751,7 +7751,7 @@ func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowWorkflowInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7760,7 +7760,7 @@ func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { func TestFlattenListWorkflowWorkflowTask(t *testing.T) { p := []models.WorkflowWorkflowTask{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.WorkflowTask","Name":"Name %d","Description":"Description %d","Label":"Label %d","ClassId":"workflow.WorkflowTask"}` + c := `{"ClassId":"workflow.WorkflowTask","ObjectType":"workflow.WorkflowTask","Description":"Description %d","Label":"Label %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowWorkflowTask(p, d) @@ -7775,7 +7775,7 @@ func TestFlattenListWorkflowWorkflowTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowWorkflowTask(p, d) - expectedOp := []map[string]interface{}{{"object_type": "workflow.WorkflowTask", "name": "Name 1", "description": "Description 1", "label": "Label 1", "class_id": "workflow.WorkflowTask"}, {"object_type": "workflow.WorkflowTask", "name": "Name 2", "description": "Description 2", "label": "Label 2", "class_id": "workflow.WorkflowTask"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.WorkflowTask", "object_type": "workflow.WorkflowTask", "description": "Description 1", "label": "Label 1", "name": "Name 1"}, {"class_id": "workflow.WorkflowTask", "object_type": "workflow.WorkflowTask", "description": "Description 2", "label": "Label 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7784,7 +7784,7 @@ func TestFlattenListWorkflowWorkflowTask(t *testing.T) { func TestFlattenListX509Certificate(t *testing.T) { p := []models.X509Certificate{} var d = &schema.ResourceData{} - c := `{"Sha256Fingerprint":"Sha256Fingerprint %d","ClassId":"x509.Certificate","PemCertificate":"PemCertificate %d","SignatureAlgorithm":"SignatureAlgorithm %d","ObjectType":"x509.Certificate"}` + c := `{"ObjectType":"x509.Certificate","Sha256Fingerprint":"Sha256Fingerprint %d","PemCertificate":"PemCertificate %d","SignatureAlgorithm":"SignatureAlgorithm %d","ClassId":"x509.Certificate"}` //test when the response is empty ffOpEmpty := flattenListX509Certificate(p, d) @@ -7799,7 +7799,7 @@ func TestFlattenListX509Certificate(t *testing.T) { p = append(p, x) } ffOp := flattenListX509Certificate(p, d) - expectedOp := []map[string]interface{}{{"sha256_fingerprint": "Sha256Fingerprint 1", "class_id": "x509.Certificate", "pem_certificate": "PemCertificate 1", "signature_algorithm": "SignatureAlgorithm 1", "object_type": "x509.Certificate"}, {"sha256_fingerprint": "Sha256Fingerprint 2", "class_id": "x509.Certificate", "pem_certificate": "PemCertificate 2", "signature_algorithm": "SignatureAlgorithm 2", "object_type": "x509.Certificate"}} + expectedOp := []map[string]interface{}{{"object_type": "x509.Certificate", "sha256_fingerprint": "Sha256Fingerprint 1", "pem_certificate": "PemCertificate 1", "signature_algorithm": "SignatureAlgorithm 1", "class_id": "x509.Certificate"}, {"object_type": "x509.Certificate", "sha256_fingerprint": "Sha256Fingerprint 2", "pem_certificate": "PemCertificate 2", "signature_algorithm": "SignatureAlgorithm 2", "class_id": "x509.Certificate"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7808,7 +7808,7 @@ func TestFlattenListX509Certificate(t *testing.T) { func TestFlattenMapAccessAddressType(t *testing.T) { p := models.AccessAddressType{} var d = &schema.ResourceData{} - c := `{"ObjectType":"access.AddressType","ClassId":"access.AddressType","EnableIpV4":true,"EnableIpV6":true}` + c := `{"EnableIpV6":true,"ClassId":"access.AddressType","ObjectType":"access.AddressType","EnableIpV4":true}` //test when the response is empty ffOpEmpty := flattenMapAccessAddressType(p, d) @@ -7819,14 +7819,14 @@ func TestFlattenMapAccessAddressType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAccessAddressType(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "access.AddressType", "class_id": "access.AddressType", "enable_ip_v4": true, "enable_ip_v6": true} + expectedOp := map[string]interface{}{"enable_ip_v6": true, "class_id": "access.AddressType", "object_type": "access.AddressType", "enable_ip_v4": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAdapterUnitRelationship(t *testing.T) { p := models.AdapterUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAdapterUnitRelationship(p, d) @@ -7837,14 +7837,14 @@ func TestFlattenMapAdapterUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAdapterUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAdapterUnitExpanderRelationship(t *testing.T) { p := models.AdapterUnitExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAdapterUnitExpanderRelationship(p, d) @@ -7855,14 +7855,14 @@ func TestFlattenMapAdapterUnitExpanderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAdapterUnitExpanderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceCertRenewalPhase(t *testing.T) { p := models.ApplianceCertRenewalPhase{} var d = &schema.ResourceData{} - c := `{"Message":"Message %d","Name":"Name %d","ClassId":"appliance.CertRenewalPhase","ObjectType":"appliance.CertRenewalPhase","Failed":true}` + c := `{"Failed":true,"Message":"Message %d","ClassId":"appliance.CertRenewalPhase","ObjectType":"appliance.CertRenewalPhase","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapApplianceCertRenewalPhase(p, d) @@ -7873,14 +7873,14 @@ func TestFlattenMapApplianceCertRenewalPhase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceCertRenewalPhase(p, d)[0] - expectedOp := map[string]interface{}{"message": "Message 1", "name": "Name 1", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase", "failed": true} + expectedOp := map[string]interface{}{"failed": true, "message": "Message 1", "class_id": "appliance.CertRenewalPhase", "object_type": "appliance.CertRenewalPhase", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceDataExportPolicyRelationship(t *testing.T) { p := models.ApplianceDataExportPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceDataExportPolicyRelationship(p, d) @@ -7891,14 +7891,14 @@ func TestFlattenMapApplianceDataExportPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceDataExportPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceGroupStatusRelationship(t *testing.T) { p := models.ApplianceGroupStatusRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceGroupStatusRelationship(p, d) @@ -7909,14 +7909,14 @@ func TestFlattenMapApplianceGroupStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceGroupStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceImageBundleRelationship(t *testing.T) { p := models.ApplianceImageBundleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceImageBundleRelationship(p, d) @@ -7927,14 +7927,14 @@ func TestFlattenMapApplianceImageBundleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceImageBundleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceNodeInfoRelationship(t *testing.T) { p := models.ApplianceNodeInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapApplianceNodeInfoRelationship(p, d) @@ -7945,14 +7945,14 @@ func TestFlattenMapApplianceNodeInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceNodeInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceNodeStatusRelationship(t *testing.T) { p := models.ApplianceNodeStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapApplianceNodeStatusRelationship(p, d) @@ -7963,14 +7963,14 @@ func TestFlattenMapApplianceNodeStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceNodeStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceSystemInfoRelationship(t *testing.T) { p := models.ApplianceSystemInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceSystemInfoRelationship(p, d) @@ -7981,14 +7981,14 @@ func TestFlattenMapApplianceSystemInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceSystemInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceSystemStatusRelationship(t *testing.T) { p := models.ApplianceSystemStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceSystemStatusRelationship(p, d) @@ -7999,14 +7999,14 @@ func TestFlattenMapApplianceSystemStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceSystemStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetClaimSignature(t *testing.T) { p := models.AssetClaimSignature{} var d = &schema.ResourceData{} - c := `{"ClassId":"asset.ClaimSignature","ObjectType":"asset.ClaimSignature"}` + c := `{"ObjectType":"asset.ClaimSignature","ClassId":"asset.ClaimSignature"}` //test when the response is empty ffOpEmpty := flattenMapAssetClaimSignature(p, d) @@ -8017,14 +8017,14 @@ func TestFlattenMapAssetClaimSignature(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetClaimSignature(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "asset.ClaimSignature", "object_type": "asset.ClaimSignature"} + expectedOp := map[string]interface{}{"object_type": "asset.ClaimSignature", "class_id": "asset.ClaimSignature"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetClusterMemberRelationship(t *testing.T) { p := models.AssetClusterMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetClusterMemberRelationship(p, d) @@ -8035,14 +8035,14 @@ func TestFlattenMapAssetClusterMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetClusterMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetContractInformation(t *testing.T) { p := models.AssetContractInformation{} var d = &schema.ResourceData{} - c := `{"ClassId":"asset.ContractInformation","ObjectType":"asset.ContractInformation","LineStatus":"LineStatus %d","ContractNumber":"ContractNumber %d"}` + c := `{"ContractNumber":"ContractNumber %d","ObjectType":"asset.ContractInformation","ClassId":"asset.ContractInformation","LineStatus":"LineStatus %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetContractInformation(p, d) @@ -8053,14 +8053,14 @@ func TestFlattenMapAssetContractInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetContractInformation(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "asset.ContractInformation", "object_type": "asset.ContractInformation", "line_status": "LineStatus 1", "contract_number": "ContractNumber 1"} + expectedOp := map[string]interface{}{"contract_number": "ContractNumber 1", "object_type": "asset.ContractInformation", "class_id": "asset.ContractInformation", "line_status": "LineStatus 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetCustomerInformation(t *testing.T) { p := models.AssetCustomerInformation{} var d = &schema.ResourceData{} - c := `{"ObjectType":"asset.CustomerInformation","ClassId":"asset.CustomerInformation","Id":"Id %d","Name":"Name %d"}` + c := `{"ClassId":"asset.CustomerInformation","ObjectType":"asset.CustomerInformation","Id":"Id %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetCustomerInformation(p, d) @@ -8071,14 +8071,14 @@ func TestFlattenMapAssetCustomerInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetCustomerInformation(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "asset.CustomerInformation", "class_id": "asset.CustomerInformation", "id": "Id 1", "name": "Name 1"} + expectedOp := map[string]interface{}{"class_id": "asset.CustomerInformation", "object_type": "asset.CustomerInformation", "id": "Id 1", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeploymentRelationship(t *testing.T) { p := models.AssetDeploymentRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeploymentRelationship(p, d) @@ -8089,14 +8089,14 @@ func TestFlattenMapAssetDeploymentRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeploymentRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeploymentDeviceInformation(t *testing.T) { p := models.AssetDeploymentDeviceInformation{} var d = &schema.ResourceData{} - c := `{"Description":"Description %d","MlbProductName":"MlbProductName %d","OldDeviceStatusDescription":"OldDeviceStatusDescription %d","OldInstanceId":"OldInstanceId %d","ItemType":"ItemType %d","ApplicationName":"ApplicationName %d","OldDeviceStatusId":32,"OldDeviceId":"OldDeviceId %d","InstanceId":"InstanceId %d","MlbProductId":32,"ClassId":"asset.DeploymentDeviceInformation","ObjectType":"asset.DeploymentDeviceInformation"}` + c := `{"ObjectType":"asset.DeploymentDeviceInformation","MlbProductId":32,"ApplicationName":"ApplicationName %d","Description":"Description %d","OldDeviceId":"OldDeviceId %d","InstanceId":"InstanceId %d","ItemType":"ItemType %d","MlbProductName":"MlbProductName %d","OldInstanceId":"OldInstanceId %d","OldDeviceStatusDescription":"OldDeviceStatusDescription %d","ClassId":"asset.DeploymentDeviceInformation","OldDeviceStatusId":32}` //test when the response is empty ffOpEmpty := flattenMapAssetDeploymentDeviceInformation(p, d) @@ -8107,14 +8107,14 @@ func TestFlattenMapAssetDeploymentDeviceInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeploymentDeviceInformation(p, d)[0] - expectedOp := map[string]interface{}{"description": "Description 1", "mlb_product_name": "MlbProductName 1", "old_device_status_description": "OldDeviceStatusDescription 1", "old_instance_id": "OldInstanceId 1", "item_type": "ItemType 1", "application_name": "ApplicationName 1", "old_device_status_id": 32, "old_device_id": "OldDeviceId 1", "instance_id": "InstanceId 1", "mlb_product_id": 32, "class_id": "asset.DeploymentDeviceInformation", "object_type": "asset.DeploymentDeviceInformation"} + expectedOp := map[string]interface{}{"object_type": "asset.DeploymentDeviceInformation", "mlb_product_id": 32, "application_name": "ApplicationName 1", "description": "Description 1", "old_device_id": "OldDeviceId 1", "instance_id": "InstanceId 1", "item_type": "ItemType 1", "mlb_product_name": "MlbProductName 1", "old_instance_id": "OldInstanceId 1", "old_device_status_description": "OldDeviceStatusDescription 1", "class_id": "asset.DeploymentDeviceInformation", "old_device_status_id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceClaimRelationship(t *testing.T) { p := models.AssetDeviceClaimRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceClaimRelationship(p, d) @@ -8125,14 +8125,14 @@ func TestFlattenMapAssetDeviceClaimRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceClaimRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceConfigurationRelationship(t *testing.T) { p := models.AssetDeviceConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceConfigurationRelationship(p, d) @@ -8143,14 +8143,14 @@ func TestFlattenMapAssetDeviceConfigurationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceConnectionRelationship(t *testing.T) { p := models.AssetDeviceConnectionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceConnectionRelationship(p, d) @@ -8161,7 +8161,7 @@ func TestFlattenMapAssetDeviceConnectionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceConnectionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8186,7 +8186,7 @@ func TestFlattenMapAssetDeviceContractInformationRelationship(t *testing.T) { func TestFlattenMapAssetDeviceInformation(t *testing.T) { p := models.AssetDeviceInformation{} var d = &schema.ResourceData{} - c := `{"ApplicationName":"ApplicationName %d","MlbProductName":"MlbProductName %d","MlbProductId":32,"OldInstanceId":"OldInstanceId %d","OldDeviceId":"OldDeviceId %d","MlbOfferType":"MlbOfferType %d","ProductType":"ProductType %d","ItemType":"ItemType %d","InstanceId":"InstanceId %d","OldDeviceStatusId":32,"ProductFamily":"ProductFamily %d","ClassId":"asset.DeviceInformation","ObjectType":"asset.DeviceInformation","UnitOfMeasure":"UnitOfMeasure %d","OldDeviceStatusDescription":"OldDeviceStatusDescription %d"}` + c := `{"ProductType":"ProductType %d","MlbProductId":32,"OldDeviceStatusDescription":"OldDeviceStatusDescription %d","ClassId":"asset.DeviceInformation","InstanceId":"InstanceId %d","UnitOfMeasure":"UnitOfMeasure %d","OldInstanceId":"OldInstanceId %d","OldDeviceId":"OldDeviceId %d","ProductFamily":"ProductFamily %d","OldDeviceStatusId":32,"ApplicationName":"ApplicationName %d","ItemType":"ItemType %d","MlbOfferType":"MlbOfferType %d","MlbProductName":"MlbProductName %d","ObjectType":"asset.DeviceInformation"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceInformation(p, d) @@ -8197,14 +8197,14 @@ func TestFlattenMapAssetDeviceInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceInformation(p, d)[0] - expectedOp := map[string]interface{}{"application_name": "ApplicationName 1", "mlb_product_name": "MlbProductName 1", "mlb_product_id": 32, "old_instance_id": "OldInstanceId 1", "old_device_id": "OldDeviceId 1", "mlb_offer_type": "MlbOfferType 1", "product_type": "ProductType 1", "item_type": "ItemType 1", "instance_id": "InstanceId 1", "old_device_status_id": 32, "product_family": "ProductFamily 1", "class_id": "asset.DeviceInformation", "object_type": "asset.DeviceInformation", "unit_of_measure": "UnitOfMeasure 1", "old_device_status_description": "OldDeviceStatusDescription 1"} + expectedOp := map[string]interface{}{"product_type": "ProductType 1", "mlb_product_id": 32, "old_device_status_description": "OldDeviceStatusDescription 1", "class_id": "asset.DeviceInformation", "instance_id": "InstanceId 1", "unit_of_measure": "UnitOfMeasure 1", "old_instance_id": "OldInstanceId 1", "old_device_id": "OldDeviceId 1", "product_family": "ProductFamily 1", "old_device_status_id": 32, "application_name": "ApplicationName 1", "item_type": "ItemType 1", "mlb_offer_type": "MlbOfferType 1", "mlb_product_name": "MlbProductName 1", "object_type": "asset.DeviceInformation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceRegistrationRelationship(t *testing.T) { p := models.AssetDeviceRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceRegistrationRelationship(p, d) @@ -8215,14 +8215,14 @@ func TestFlattenMapAssetDeviceRegistrationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceRegistrationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceStatistics(t *testing.T) { p := models.AssetDeviceStatistics{} var d = &schema.ResourceData{} - c := `{"ClusterName":"ClusterName %d","Connected":32,"MembershipRatio":32.000000,"MemoryMirroringFactor":32.000000,"ClassId":"asset.DeviceStatistics","ObjectType":"asset.DeviceStatistics"}` + c := `{"Connected":32,"MembershipRatio":32.000000,"MemoryMirroringFactor":32.000000,"ObjectType":"asset.DeviceStatistics","ClassId":"asset.DeviceStatistics","ClusterName":"ClusterName %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceStatistics(p, d) @@ -8233,14 +8233,14 @@ func TestFlattenMapAssetDeviceStatistics(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceStatistics(p, d)[0] - expectedOp := map[string]interface{}{"cluster_name": "ClusterName 1", "connected": 32, "membership_ratio": 32.000000, "memory_mirroring_factor": 32.000000, "class_id": "asset.DeviceStatistics", "object_type": "asset.DeviceStatistics"} + expectedOp := map[string]interface{}{"connected": 32, "membership_ratio": 32.000000, "memory_mirroring_factor": 32.000000, "object_type": "asset.DeviceStatistics", "class_id": "asset.DeviceStatistics", "cluster_name": "ClusterName 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetGlobalUltimate(t *testing.T) { p := models.AssetGlobalUltimate{} var d = &schema.ResourceData{} - c := `{"ObjectType":"asset.GlobalUltimate","ClassId":"asset.GlobalUltimate","Id":"Id %d","Name":"Name %d"}` + c := `{"ClassId":"asset.GlobalUltimate","ObjectType":"asset.GlobalUltimate","Name":"Name %d","Id":"Id %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetGlobalUltimate(p, d) @@ -8251,14 +8251,14 @@ func TestFlattenMapAssetGlobalUltimate(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetGlobalUltimate(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "asset.GlobalUltimate", "class_id": "asset.GlobalUltimate", "id": "Id 1", "name": "Name 1"} + expectedOp := map[string]interface{}{"class_id": "asset.GlobalUltimate", "object_type": "asset.GlobalUltimate", "name": "Name 1", "id": "Id 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetProductInformation(t *testing.T) { p := models.AssetProductInformation{} var d = &schema.ResourceData{} - c := `{"Group":"Group %d","SubType":"SubType %d","Description":"Description %d","Family":"Family %d","ClassId":"asset.ProductInformation","ObjectType":"asset.ProductInformation","Number":"Number %d"}` + c := `{"ObjectType":"asset.ProductInformation","ClassId":"asset.ProductInformation","Number":"Number %d","Description":"Description %d","Family":"Family %d","Group":"Group %d","SubType":"SubType %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetProductInformation(p, d) @@ -8269,14 +8269,14 @@ func TestFlattenMapAssetProductInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetProductInformation(p, d)[0] - expectedOp := map[string]interface{}{"group": "Group 1", "sub_type": "SubType 1", "description": "Description 1", "family": "Family 1", "class_id": "asset.ProductInformation", "object_type": "asset.ProductInformation", "number": "Number 1"} + expectedOp := map[string]interface{}{"object_type": "asset.ProductInformation", "class_id": "asset.ProductInformation", "number": "Number 1", "description": "Description 1", "family": "Family 1", "group": "Group 1", "sub_type": "SubType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSubscriptionRelationship(t *testing.T) { p := models.AssetSubscriptionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetSubscriptionRelationship(p, d) @@ -8287,14 +8287,14 @@ func TestFlattenMapAssetSubscriptionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSubscriptionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSubscriptionAccountRelationship(t *testing.T) { p := models.AssetSubscriptionAccountRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetSubscriptionAccountRelationship(p, d) @@ -8305,14 +8305,14 @@ func TestFlattenMapAssetSubscriptionAccountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSubscriptionAccountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSudiInfo(t *testing.T) { p := models.AssetSudiInfo{} var d = &schema.ResourceData{} - c := `{"Signature":"Signature %d","Status":"Status %d","ClassId":"asset.SudiInfo","ObjectType":"asset.SudiInfo","Pid":"Pid %d","SerialNumber":"SerialNumber %d"}` + c := `{"ClassId":"asset.SudiInfo","Pid":"Pid %d","SerialNumber":"SerialNumber %d","Signature":"Signature %d","Status":"Status %d","ObjectType":"asset.SudiInfo"}` //test when the response is empty ffOpEmpty := flattenMapAssetSudiInfo(p, d) @@ -8323,14 +8323,14 @@ func TestFlattenMapAssetSudiInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSudiInfo(p, d)[0] - expectedOp := map[string]interface{}{"signature": "Signature 1", "status": "Status 1", "class_id": "asset.SudiInfo", "object_type": "asset.SudiInfo", "pid": "Pid 1", "serial_number": "SerialNumber 1"} + expectedOp := map[string]interface{}{"class_id": "asset.SudiInfo", "pid": "Pid 1", "serial_number": "SerialNumber 1", "signature": "Signature 1", "status": "Status 1", "object_type": "asset.SudiInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetTargetRelationship(t *testing.T) { p := models.AssetTargetRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetTargetRelationship(p, d) @@ -8341,7 +8341,7 @@ func TestFlattenMapAssetTargetRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetTargetRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8384,7 +8384,7 @@ func TestFlattenMapBiosSystemBootOrderRelationship(t *testing.T) { func TestFlattenMapBiosTokenSettingsRelationship(t *testing.T) { p := models.BiosTokenSettingsRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapBiosTokenSettingsRelationship(p, d) @@ -8395,14 +8395,14 @@ func TestFlattenMapBiosTokenSettingsRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosTokenSettingsRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBiosUnitRelationship(t *testing.T) { p := models.BiosUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapBiosUnitRelationship(p, d) @@ -8413,14 +8413,14 @@ func TestFlattenMapBiosUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBiosVfSelectMemoryRasConfigurationRelationship(t *testing.T) { p := models.BiosVfSelectMemoryRasConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBiosVfSelectMemoryRasConfigurationRelationship(p, d) @@ -8431,14 +8431,14 @@ func TestFlattenMapBiosVfSelectMemoryRasConfigurationRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosVfSelectMemoryRasConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBootDeviceBootModeRelationship(t *testing.T) { p := models.BootDeviceBootModeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBootDeviceBootModeRelationship(p, d) @@ -8449,14 +8449,14 @@ func TestFlattenMapBootDeviceBootModeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBootDeviceBootModeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBootDeviceBootSecurityRelationship(t *testing.T) { p := models.BootDeviceBootSecurityRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBootDeviceBootSecurityRelationship(p, d) @@ -8467,14 +8467,14 @@ func TestFlattenMapBootDeviceBootSecurityRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBootDeviceBootSecurityRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchNetworkLimits(t *testing.T) { p := models.CapabilitySwitchNetworkLimits{} var d = &schema.ResourceData{} - c := `{"MaximumPrimaryVlan":32,"MaximumEthernetPortChannels":32,"MaximumFcPortChannelMembers":32,"MaxUncompressedPortVlanCount":32,"MaxCompressedPortVlanCount":32,"ClassId":"capability.SwitchNetworkLimits","ObjectType":"capability.SwitchNetworkLimits","MaximumActiveTrafficMonitoringSessions":32,"MaximumSecondaryVlan":32,"MaximumSecondaryVlanPerPrimary":32,"MaximumVlans":32,"MaximumIgmpGroups":32,"MaximumFcPortChannels":32,"MinimumActiveFans":32,"MaximumPortChannelMembers":32,"MaximumVifs":32,"MaximumEthernetUplinkPorts":32}` + c := `{"MaxUncompressedPortVlanCount":32,"MaximumPortChannelMembers":32,"MaximumActiveTrafficMonitoringSessions":32,"MaximumFcPortChannels":32,"MaximumSecondaryVlanPerPrimary":32,"MaximumEthernetPortChannels":32,"MaximumFcPortChannelMembers":32,"MinimumActiveFans":32,"MaximumEthernetUplinkPorts":32,"MaximumPrimaryVlan":32,"ClassId":"capability.SwitchNetworkLimits","MaximumSecondaryVlan":32,"MaximumVlans":32,"MaxCompressedPortVlanCount":32,"ObjectType":"capability.SwitchNetworkLimits","MaximumIgmpGroups":32,"MaximumVifs":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchNetworkLimits(p, d) @@ -8485,14 +8485,14 @@ func TestFlattenMapCapabilitySwitchNetworkLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchNetworkLimits(p, d)[0] - expectedOp := map[string]interface{}{"maximum_primary_vlan": 32, "maximum_ethernet_port_channels": 32, "maximum_fc_port_channel_members": 32, "max_uncompressed_port_vlan_count": 32, "max_compressed_port_vlan_count": 32, "class_id": "capability.SwitchNetworkLimits", "object_type": "capability.SwitchNetworkLimits", "maximum_active_traffic_monitoring_sessions": 32, "maximum_secondary_vlan": 32, "maximum_secondary_vlan_per_primary": 32, "maximum_vlans": 32, "maximum_igmp_groups": 32, "maximum_fc_port_channels": 32, "minimum_active_fans": 32, "maximum_port_channel_members": 32, "maximum_vifs": 32, "maximum_ethernet_uplink_ports": 32} + expectedOp := map[string]interface{}{"max_uncompressed_port_vlan_count": 32, "maximum_port_channel_members": 32, "maximum_active_traffic_monitoring_sessions": 32, "maximum_fc_port_channels": 32, "maximum_secondary_vlan_per_primary": 32, "maximum_ethernet_port_channels": 32, "maximum_fc_port_channel_members": 32, "minimum_active_fans": 32, "maximum_ethernet_uplink_ports": 32, "maximum_primary_vlan": 32, "class_id": "capability.SwitchNetworkLimits", "maximum_secondary_vlan": 32, "maximum_vlans": 32, "max_compressed_port_vlan_count": 32, "object_type": "capability.SwitchNetworkLimits", "maximum_igmp_groups": 32, "maximum_vifs": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchStorageLimits(t *testing.T) { p := models.CapabilitySwitchStorageLimits{} var d = &schema.ResourceData{} - c := `{"MaximumZoneCount":32,"MaximumUserZoneCount":32,"MaximumVirtualFcInterfaces":32,"MaximumVirtualFcInterfacesPerBladeServer":32,"MaximumVsans":32,"ClassId":"capability.SwitchStorageLimits","ObjectType":"capability.SwitchStorageLimits"}` + c := `{"MaximumVirtualFcInterfacesPerBladeServer":32,"ClassId":"capability.SwitchStorageLimits","ObjectType":"capability.SwitchStorageLimits","MaximumVsans":32,"MaximumZoneCount":32,"MaximumUserZoneCount":32,"MaximumVirtualFcInterfaces":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchStorageLimits(p, d) @@ -8503,14 +8503,14 @@ func TestFlattenMapCapabilitySwitchStorageLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchStorageLimits(p, d)[0] - expectedOp := map[string]interface{}{"maximum_zone_count": 32, "maximum_user_zone_count": 32, "maximum_virtual_fc_interfaces": 32, "maximum_virtual_fc_interfaces_per_blade_server": 32, "maximum_vsans": 32, "class_id": "capability.SwitchStorageLimits", "object_type": "capability.SwitchStorageLimits"} + expectedOp := map[string]interface{}{"maximum_virtual_fc_interfaces_per_blade_server": 32, "class_id": "capability.SwitchStorageLimits", "object_type": "capability.SwitchStorageLimits", "maximum_vsans": 32, "maximum_zone_count": 32, "maximum_user_zone_count": 32, "maximum_virtual_fc_interfaces": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchSystemLimits(t *testing.T) { p := models.CapabilitySwitchSystemLimits{} var d = &schema.ResourceData{} - c := `{"MaximumChassisCount":32,"MaximumFexPerDomain":32,"MaximumServersPerDomain":32,"ClassId":"capability.SwitchSystemLimits","ObjectType":"capability.SwitchSystemLimits"}` + c := `{"ClassId":"capability.SwitchSystemLimits","ObjectType":"capability.SwitchSystemLimits","MaximumFexPerDomain":32,"MaximumServersPerDomain":32,"MaximumChassisCount":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchSystemLimits(p, d) @@ -8521,14 +8521,14 @@ func TestFlattenMapCapabilitySwitchSystemLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchSystemLimits(p, d)[0] - expectedOp := map[string]interface{}{"maximum_chassis_count": 32, "maximum_fex_per_domain": 32, "maximum_servers_per_domain": 32, "class_id": "capability.SwitchSystemLimits", "object_type": "capability.SwitchSystemLimits"} + expectedOp := map[string]interface{}{"class_id": "capability.SwitchSystemLimits", "object_type": "capability.SwitchSystemLimits", "maximum_fex_per_domain": 32, "maximum_servers_per_domain": 32, "maximum_chassis_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCertificatemanagementCertificateBase(t *testing.T) { p := models.CertificatemanagementCertificateBase{} var d = &schema.ResourceData{} - c := `{"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","IsPrivatekeySet":true,"Enabled":true}` + c := `{"IsPrivatekeySet":true,"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","Enabled":true}` //test when the response is empty ffOpEmpty := flattenMapCertificatemanagementCertificateBase(p, d) @@ -8539,14 +8539,14 @@ func TestFlattenMapCertificatemanagementCertificateBase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCertificatemanagementCertificateBase(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "is_privatekey_set": true, "enabled": true} + expectedOp := map[string]interface{}{"is_privatekey_set": true, "class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapChassisConfigResultRelationship(t *testing.T) { p := models.ChassisConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapChassisConfigResultRelationship(p, d) @@ -8557,14 +8557,14 @@ func TestFlattenMapChassisConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapChassisConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapChassisProfileRelationship(t *testing.T) { p := models.ChassisProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapChassisProfileRelationship(p, d) @@ -8575,7 +8575,7 @@ func TestFlattenMapChassisProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapChassisProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8600,7 +8600,7 @@ func TestFlattenMapCloudAvailabilityZone(t *testing.T) { func TestFlattenMapCloudAwsBillingUnitRelationship(t *testing.T) { p := models.CloudAwsBillingUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudAwsBillingUnitRelationship(p, d) @@ -8611,7 +8611,7 @@ func TestFlattenMapCloudAwsBillingUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAwsBillingUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8636,7 +8636,7 @@ func TestFlattenMapCloudAwsKeyPairRelationship(t *testing.T) { func TestFlattenMapCloudAwsOrganizationalUnitRelationship(t *testing.T) { p := models.CloudAwsOrganizationalUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudAwsOrganizationalUnitRelationship(p, d) @@ -8647,7 +8647,7 @@ func TestFlattenMapCloudAwsOrganizationalUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAwsOrganizationalUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8690,7 +8690,7 @@ func TestFlattenMapCloudAwsVpcRelationship(t *testing.T) { func TestFlattenMapCloudBillingUnit(t *testing.T) { p := models.CloudBillingUnit{} var d = &schema.ResourceData{} - c := `{"ClassId":"cloud.BillingUnit","ObjectType":"cloud.BillingUnit","BillingId":"BillingId %d","Name":"Name %d"}` + c := `{"BillingId":"BillingId %d","Name":"Name %d","ClassId":"cloud.BillingUnit","ObjectType":"cloud.BillingUnit"}` //test when the response is empty ffOpEmpty := flattenMapCloudBillingUnit(p, d) @@ -8701,14 +8701,14 @@ func TestFlattenMapCloudBillingUnit(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudBillingUnit(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "cloud.BillingUnit", "object_type": "cloud.BillingUnit", "billing_id": "BillingId 1", "name": "Name 1"} + expectedOp := map[string]interface{}{"billing_id": "BillingId 1", "name": "Name 1", "class_id": "cloud.BillingUnit", "object_type": "cloud.BillingUnit"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudCloudRegion(t *testing.T) { p := models.CloudCloudRegion{} var d = &schema.ResourceData{} - c := `{"ClassId":"cloud.CloudRegion","ObjectType":"cloud.CloudRegion","Name":"Name %d","RegionId":"RegionId %d"}` + c := `{"RegionId":"RegionId %d","ClassId":"cloud.CloudRegion","ObjectType":"cloud.CloudRegion","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudCloudRegion(p, d) @@ -8719,7 +8719,7 @@ func TestFlattenMapCloudCloudRegion(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudCloudRegion(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "cloud.CloudRegion", "object_type": "cloud.CloudRegion", "name": "Name 1", "region_id": "RegionId 1"} + expectedOp := map[string]interface{}{"region_id": "RegionId 1", "class_id": "cloud.CloudRegion", "object_type": "cloud.CloudRegion", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8744,7 +8744,7 @@ func TestFlattenMapCloudImageReference(t *testing.T) { func TestFlattenMapCloudInstanceType(t *testing.T) { p := models.CloudInstanceType{} var d = &schema.ResourceData{} - c := `{"Architecture":"Architecture %d","ObjectType":"cloud.InstanceType","Name":"Name %d","Cpus":32,"InstanceTypeId":"InstanceTypeId %d","Platform":"Platform %d","ClassId":"cloud.InstanceType","Memory":32,"CpuSpeed":32}` + c := `{"CpuSpeed":32,"ClassId":"cloud.InstanceType","ObjectType":"cloud.InstanceType","InstanceTypeId":"InstanceTypeId %d","Platform":"Platform %d","Cpus":32,"Name":"Name %d","Memory":32,"Architecture":"Architecture %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudInstanceType(p, d) @@ -8755,7 +8755,7 @@ func TestFlattenMapCloudInstanceType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudInstanceType(p, d)[0] - expectedOp := map[string]interface{}{"architecture": "Architecture 1", "object_type": "cloud.InstanceType", "name": "Name 1", "cpus": 32, "instance_type_id": "InstanceTypeId 1", "platform": "Platform 1", "class_id": "cloud.InstanceType", "memory": 32, "cpu_speed": 32} + expectedOp := map[string]interface{}{"cpu_speed": 32, "class_id": "cloud.InstanceType", "object_type": "cloud.InstanceType", "instance_type_id": "InstanceTypeId 1", "platform": "Platform 1", "cpus": 32, "name": "Name 1", "memory": 32, "architecture": "Architecture 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8780,7 +8780,7 @@ func TestFlattenMapCloudNetworkInstanceAttachment(t *testing.T) { func TestFlattenMapCloudTfcOrganizationRelationship(t *testing.T) { p := models.CloudTfcOrganizationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudTfcOrganizationRelationship(p, d) @@ -8791,14 +8791,14 @@ func TestFlattenMapCloudTfcOrganizationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudTfcOrganizationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudVolumeIopsInfo(t *testing.T) { p := models.CloudVolumeIopsInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"cloud.VolumeIopsInfo","ObjectType":"cloud.VolumeIopsInfo","ThroughputReadLimit":32,"ThroughputWriteLimit":32,"IopsReadLimit":32,"IopsWriteLimit":32}` + c := `{"ThroughputWriteLimit":32,"IopsReadLimit":32,"IopsWriteLimit":32,"ThroughputReadLimit":32,"ClassId":"cloud.VolumeIopsInfo","ObjectType":"cloud.VolumeIopsInfo"}` //test when the response is empty ffOpEmpty := flattenMapCloudVolumeIopsInfo(p, d) @@ -8809,14 +8809,14 @@ func TestFlattenMapCloudVolumeIopsInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudVolumeIopsInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "cloud.VolumeIopsInfo", "object_type": "cloud.VolumeIopsInfo", "throughput_read_limit": 32, "throughput_write_limit": 32, "iops_read_limit": 32, "iops_write_limit": 32} + expectedOp := map[string]interface{}{"throughput_write_limit": 32, "iops_read_limit": 32, "iops_write_limit": 32, "throughput_read_limit": 32, "class_id": "cloud.VolumeIopsInfo", "object_type": "cloud.VolumeIopsInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudVolumeType(t *testing.T) { p := models.CloudVolumeType{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","VolumeTypeId":"VolumeTypeId %d","ClassId":"cloud.VolumeType","ObjectType":"cloud.VolumeType"}` + c := `{"ObjectType":"cloud.VolumeType","Name":"Name %d","VolumeTypeId":"VolumeTypeId %d","ClassId":"cloud.VolumeType"}` //test when the response is empty ffOpEmpty := flattenMapCloudVolumeType(p, d) @@ -8827,14 +8827,14 @@ func TestFlattenMapCloudVolumeType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudVolumeType(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "volume_type_id": "VolumeTypeId 1", "class_id": "cloud.VolumeType", "object_type": "cloud.VolumeType"} + expectedOp := map[string]interface{}{"object_type": "cloud.VolumeType", "name": "Name 1", "volume_type_id": "VolumeTypeId 1", "class_id": "cloud.VolumeType"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCommHttpProxyPolicyRelationship(t *testing.T) { p := models.CommHttpProxyPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCommHttpProxyPolicyRelationship(p, d) @@ -8845,14 +8845,14 @@ func TestFlattenMapCommHttpProxyPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommHttpProxyPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCommIpV4Interface(t *testing.T) { p := models.CommIpV4Interface{} var d = &schema.ResourceData{} - c := `{"Gateway":"Gateway %d","IpAddress":"IpAddress %d","Netmask":"Netmask %d","ClassId":"comm.IpV4Interface","ObjectType":"comm.IpV4Interface"}` + c := `{"Gateway":"Gateway %d","IpAddress":"IpAddress %d","Netmask":"Netmask %d","ObjectType":"comm.IpV4Interface","ClassId":"comm.IpV4Interface"}` //test when the response is empty ffOpEmpty := flattenMapCommIpV4Interface(p, d) @@ -8863,14 +8863,14 @@ func TestFlattenMapCommIpV4Interface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommIpV4Interface(p, d)[0] - expectedOp := map[string]interface{}{"gateway": "Gateway 1", "ip_address": "IpAddress 1", "netmask": "Netmask 1", "class_id": "comm.IpV4Interface", "object_type": "comm.IpV4Interface"} + expectedOp := map[string]interface{}{"gateway": "Gateway 1", "ip_address": "IpAddress 1", "netmask": "Netmask 1", "object_type": "comm.IpV4Interface", "class_id": "comm.IpV4Interface"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCommIpV6Interface(t *testing.T) { p := models.CommIpV6Interface{} var d = &schema.ResourceData{} - c := `{"Prefix":"Prefix %d","ClassId":"comm.IpV6Interface","ObjectType":"comm.IpV6Interface","Gateway":"Gateway %d","IpAddress":"IpAddress %d"}` + c := `{"Prefix":"Prefix %d","Gateway":"Gateway %d","ObjectType":"comm.IpV6Interface","ClassId":"comm.IpV6Interface","IpAddress":"IpAddress %d"}` //test when the response is empty ffOpEmpty := flattenMapCommIpV6Interface(p, d) @@ -8881,14 +8881,14 @@ func TestFlattenMapCommIpV6Interface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommIpV6Interface(p, d)[0] - expectedOp := map[string]interface{}{"prefix": "Prefix 1", "class_id": "comm.IpV6Interface", "object_type": "comm.IpV6Interface", "gateway": "Gateway 1", "ip_address": "IpAddress 1"} + expectedOp := map[string]interface{}{"prefix": "Prefix 1", "gateway": "Gateway 1", "object_type": "comm.IpV6Interface", "class_id": "comm.IpV6Interface", "ip_address": "IpAddress 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeAlarmSummary(t *testing.T) { p := models.ComputeAlarmSummary{} var d = &schema.ResourceData{} - c := `{"Warning":32,"ClassId":"compute.AlarmSummary","ObjectType":"compute.AlarmSummary","Critical":32}` + c := `{"ObjectType":"compute.AlarmSummary","ClassId":"compute.AlarmSummary","Critical":32,"Warning":32}` //test when the response is empty ffOpEmpty := flattenMapComputeAlarmSummary(p, d) @@ -8899,14 +8899,14 @@ func TestFlattenMapComputeAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"warning": 32, "class_id": "compute.AlarmSummary", "object_type": "compute.AlarmSummary", "critical": 32} + expectedOp := map[string]interface{}{"object_type": "compute.AlarmSummary", "class_id": "compute.AlarmSummary", "critical": 32, "warning": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeBladeRelationship(t *testing.T) { p := models.ComputeBladeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeBladeRelationship(p, d) @@ -8917,14 +8917,14 @@ func TestFlattenMapComputeBladeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeBladeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeBoardRelationship(t *testing.T) { p := models.ComputeBoardRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapComputeBoardRelationship(p, d) @@ -8935,14 +8935,14 @@ func TestFlattenMapComputeBoardRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeBoardRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputePersistentMemoryOperation(t *testing.T) { p := models.ComputePersistentMemoryOperation{} var d = &schema.ResourceData{} - c := `{"ClassId":"compute.PersistentMemoryOperation","ObjectType":"compute.PersistentMemoryOperation","IsSecurePassphraseSet":true,"AdminAction":"AdminAction %d"}` + c := `{"ObjectType":"compute.PersistentMemoryOperation","ClassId":"compute.PersistentMemoryOperation","AdminAction":"AdminAction %d","IsSecurePassphraseSet":true}` //test when the response is empty ffOpEmpty := flattenMapComputePersistentMemoryOperation(p, d) @@ -8953,14 +8953,14 @@ func TestFlattenMapComputePersistentMemoryOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputePersistentMemoryOperation(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "compute.PersistentMemoryOperation", "object_type": "compute.PersistentMemoryOperation", "is_secure_passphrase_set": true, "admin_action": "AdminAction 1"} + expectedOp := map[string]interface{}{"object_type": "compute.PersistentMemoryOperation", "class_id": "compute.PersistentMemoryOperation", "admin_action": "AdminAction 1", "is_secure_passphrase_set": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputePhysicalRelationship(t *testing.T) { p := models.ComputePhysicalRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapComputePhysicalRelationship(p, d) @@ -8971,14 +8971,14 @@ func TestFlattenMapComputePhysicalRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputePhysicalRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputePhysicalSummaryRelationship(t *testing.T) { p := models.ComputePhysicalSummaryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapComputePhysicalSummaryRelationship(p, d) @@ -8989,14 +8989,14 @@ func TestFlattenMapComputePhysicalSummaryRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputePhysicalSummaryRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeRackUnitRelationship(t *testing.T) { p := models.ComputeRackUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeRackUnitRelationship(p, d) @@ -9007,14 +9007,14 @@ func TestFlattenMapComputeRackUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeRackUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeServerConfig(t *testing.T) { p := models.ComputeServerConfig{} var d = &schema.ResourceData{} - c := `{"UserLabel":"UserLabel %d","ClassId":"compute.ServerConfig","ObjectType":"compute.ServerConfig","AssetTag":"AssetTag %d"}` + c := `{"ClassId":"compute.ServerConfig","ObjectType":"compute.ServerConfig","AssetTag":"AssetTag %d","UserLabel":"UserLabel %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeServerConfig(p, d) @@ -9025,14 +9025,14 @@ func TestFlattenMapComputeServerConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeServerConfig(p, d)[0] - expectedOp := map[string]interface{}{"user_label": "UserLabel 1", "class_id": "compute.ServerConfig", "object_type": "compute.ServerConfig", "asset_tag": "AssetTag 1"} + expectedOp := map[string]interface{}{"class_id": "compute.ServerConfig", "object_type": "compute.ServerConfig", "asset_tag": "AssetTag 1", "user_label": "UserLabel 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeStorageControllerOperation(t *testing.T) { p := models.ComputeStorageControllerOperation{} var d = &schema.ResourceData{} - c := `{"AdminAction":"AdminAction %d","ControllerId":"ControllerId %d","ClassId":"compute.StorageControllerOperation","ObjectType":"compute.StorageControllerOperation"}` + c := `{"ClassId":"compute.StorageControllerOperation","ObjectType":"compute.StorageControllerOperation","AdminAction":"AdminAction %d","ControllerId":"ControllerId %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeStorageControllerOperation(p, d) @@ -9043,14 +9043,14 @@ func TestFlattenMapComputeStorageControllerOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeStorageControllerOperation(p, d)[0] - expectedOp := map[string]interface{}{"admin_action": "AdminAction 1", "controller_id": "ControllerId 1", "class_id": "compute.StorageControllerOperation", "object_type": "compute.StorageControllerOperation"} + expectedOp := map[string]interface{}{"class_id": "compute.StorageControllerOperation", "object_type": "compute.StorageControllerOperation", "admin_action": "AdminAction 1", "controller_id": "ControllerId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeStoragePhysicalDriveOperation(t *testing.T) { p := models.ComputeStoragePhysicalDriveOperation{} var d = &schema.ResourceData{} - c := `{"AdminAction":"AdminAction %d","ControllerId":"ControllerId %d","ClassId":"compute.StoragePhysicalDriveOperation","ObjectType":"compute.StoragePhysicalDriveOperation"}` + c := `{"AdminAction":"AdminAction %d","ClassId":"compute.StoragePhysicalDriveOperation","ObjectType":"compute.StoragePhysicalDriveOperation","ControllerId":"ControllerId %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeStoragePhysicalDriveOperation(p, d) @@ -9061,14 +9061,14 @@ func TestFlattenMapComputeStoragePhysicalDriveOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeStoragePhysicalDriveOperation(p, d)[0] - expectedOp := map[string]interface{}{"admin_action": "AdminAction 1", "controller_id": "ControllerId 1", "class_id": "compute.StoragePhysicalDriveOperation", "object_type": "compute.StoragePhysicalDriveOperation"} + expectedOp := map[string]interface{}{"admin_action": "AdminAction 1", "class_id": "compute.StoragePhysicalDriveOperation", "object_type": "compute.StoragePhysicalDriveOperation", "controller_id": "ControllerId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeStorageVirtualDriveOperation(t *testing.T) { p := models.ComputeStorageVirtualDriveOperation{} var d = &schema.ResourceData{} - c := `{"ObjectType":"compute.StorageVirtualDriveOperation","ClassId":"compute.StorageVirtualDriveOperation","AdminAction":"AdminAction %d","ControllerId":"ControllerId %d"}` + c := `{"AdminAction":"AdminAction %d","ControllerId":"ControllerId %d","ClassId":"compute.StorageVirtualDriveOperation","ObjectType":"compute.StorageVirtualDriveOperation"}` //test when the response is empty ffOpEmpty := flattenMapComputeStorageVirtualDriveOperation(p, d) @@ -9079,7 +9079,7 @@ func TestFlattenMapComputeStorageVirtualDriveOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeStorageVirtualDriveOperation(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "compute.StorageVirtualDriveOperation", "class_id": "compute.StorageVirtualDriveOperation", "admin_action": "AdminAction 1", "controller_id": "ControllerId 1"} + expectedOp := map[string]interface{}{"admin_action": "AdminAction 1", "controller_id": "ControllerId 1", "class_id": "compute.StorageVirtualDriveOperation", "object_type": "compute.StorageVirtualDriveOperation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9104,7 +9104,7 @@ func TestFlattenMapComputeVmediaRelationship(t *testing.T) { func TestFlattenMapCondAlarmSummary(t *testing.T) { p := models.CondAlarmSummary{} var d = &schema.ResourceData{} - c := `{"ClassId":"cond.AlarmSummary","ObjectType":"cond.AlarmSummary","Critical":32,"Warning":32}` + c := `{"ObjectType":"cond.AlarmSummary","Critical":32,"Warning":32,"ClassId":"cond.AlarmSummary"}` //test when the response is empty ffOpEmpty := flattenMapCondAlarmSummary(p, d) @@ -9115,7 +9115,7 @@ func TestFlattenMapCondAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCondAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "cond.AlarmSummary", "object_type": "cond.AlarmSummary", "critical": 32, "warning": 32} + expectedOp := map[string]interface{}{"object_type": "cond.AlarmSummary", "critical": 32, "warning": 32, "class_id": "cond.AlarmSummary"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9140,7 +9140,7 @@ func TestFlattenMapCondHclStatusRelationship(t *testing.T) { func TestFlattenMapConfigExportedItemRelationship(t *testing.T) { p := models.ConfigExportedItemRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapConfigExportedItemRelationship(p, d) @@ -9151,14 +9151,14 @@ func TestFlattenMapConfigExportedItemRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConfigExportedItemRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapConfigExporterRelationship(t *testing.T) { p := models.ConfigExporterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapConfigExporterRelationship(p, d) @@ -9169,14 +9169,14 @@ func TestFlattenMapConfigExporterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConfigExporterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapConfigImporterRelationship(t *testing.T) { p := models.ConfigImporterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapConfigImporterRelationship(p, d) @@ -9187,7 +9187,7 @@ func TestFlattenMapConfigImporterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConfigImporterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9212,7 +9212,7 @@ func TestFlattenMapConfigMoRef(t *testing.T) { func TestFlattenMapConnectorFileChecksum(t *testing.T) { p := models.ConnectorFileChecksum{} var d = &schema.ResourceData{} - c := `{"ClassId":"connector.FileChecksum","ObjectType":"connector.FileChecksum","HashAlgorithm":"HashAlgorithm %d"}` + c := `{"ObjectType":"connector.FileChecksum","ClassId":"connector.FileChecksum","HashAlgorithm":"HashAlgorithm %d"}` //test when the response is empty ffOpEmpty := flattenMapConnectorFileChecksum(p, d) @@ -9223,14 +9223,14 @@ func TestFlattenMapConnectorFileChecksum(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConnectorFileChecksum(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "connector.FileChecksum", "object_type": "connector.FileChecksum", "hash_algorithm": "HashAlgorithm 1"} + expectedOp := map[string]interface{}{"object_type": "connector.FileChecksum", "class_id": "connector.FileChecksum", "hash_algorithm": "HashAlgorithm 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapConnectorPlatformParamBase(t *testing.T) { p := models.ConnectorPlatformParamBase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"connector.PlatformParamBase","ClassId":"connector.PlatformParamBase"}` + c := `{"ClassId":"connector.PlatformParamBase","ObjectType":"connector.PlatformParamBase"}` //test when the response is empty ffOpEmpty := flattenMapConnectorPlatformParamBase(p, d) @@ -9241,14 +9241,14 @@ func TestFlattenMapConnectorPlatformParamBase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConnectorPlatformParamBase(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "connector.PlatformParamBase", "class_id": "connector.PlatformParamBase"} + expectedOp := map[string]interface{}{"class_id": "connector.PlatformParamBase", "object_type": "connector.PlatformParamBase"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentBaseRelationship(t *testing.T) { p := models.EquipmentBaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentBaseRelationship(p, d) @@ -9259,14 +9259,14 @@ func TestFlattenMapEquipmentBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentChassisRelationship(t *testing.T) { p := models.EquipmentChassisRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentChassisRelationship(p, d) @@ -9277,14 +9277,14 @@ func TestFlattenMapEquipmentChassisRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentChassisRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFanControlRelationship(t *testing.T) { p := models.EquipmentFanControlRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFanControlRelationship(p, d) @@ -9295,14 +9295,14 @@ func TestFlattenMapEquipmentFanControlRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFanControlRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFanModuleRelationship(t *testing.T) { p := models.EquipmentFanModuleRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFanModuleRelationship(p, d) @@ -9313,14 +9313,14 @@ func TestFlattenMapEquipmentFanModuleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFanModuleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFexRelationship(t *testing.T) { p := models.EquipmentFexRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFexRelationship(p, d) @@ -9331,14 +9331,14 @@ func TestFlattenMapEquipmentFexRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFexRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFruRelationship(t *testing.T) { p := models.EquipmentFruRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFruRelationship(p, d) @@ -9349,14 +9349,14 @@ func TestFlattenMapEquipmentFruRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFruRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentIoCardRelationship(t *testing.T) { p := models.EquipmentIoCardRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentIoCardRelationship(p, d) @@ -9367,7 +9367,7 @@ func TestFlattenMapEquipmentIoCardRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentIoCardRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9392,7 +9392,7 @@ func TestFlattenMapEquipmentIoCardBaseRelationship(t *testing.T) { func TestFlattenMapEquipmentLocatorLedRelationship(t *testing.T) { p := models.EquipmentLocatorLedRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentLocatorLedRelationship(p, d) @@ -9403,7 +9403,7 @@ func TestFlattenMapEquipmentLocatorLedRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentLocatorLedRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9446,7 +9446,7 @@ func TestFlattenMapEquipmentPsuControlRelationship(t *testing.T) { func TestFlattenMapEquipmentRackEnclosureRelationship(t *testing.T) { p := models.EquipmentRackEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentRackEnclosureRelationship(p, d) @@ -9457,14 +9457,14 @@ func TestFlattenMapEquipmentRackEnclosureRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentRackEnclosureRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentRackEnclosureSlotRelationship(t *testing.T) { p := models.EquipmentRackEnclosureSlotRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentRackEnclosureSlotRelationship(p, d) @@ -9475,14 +9475,14 @@ func TestFlattenMapEquipmentRackEnclosureSlotRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentRackEnclosureSlotRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentSharedIoModuleRelationship(t *testing.T) { p := models.EquipmentSharedIoModuleRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentSharedIoModuleRelationship(p, d) @@ -9493,14 +9493,14 @@ func TestFlattenMapEquipmentSharedIoModuleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentSharedIoModuleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentSwitchCardRelationship(t *testing.T) { p := models.EquipmentSwitchCardRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentSwitchCardRelationship(p, d) @@ -9511,7 +9511,7 @@ func TestFlattenMapEquipmentSwitchCardRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentSwitchCardRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9554,7 +9554,7 @@ func TestFlattenMapEtherPhysicalPortRelationship(t *testing.T) { func TestFlattenMapEtherPhysicalPortBaseRelationship(t *testing.T) { p := models.EtherPhysicalPortBaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEtherPhysicalPortBaseRelationship(p, d) @@ -9565,14 +9565,14 @@ func TestFlattenMapEtherPhysicalPortBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEtherPhysicalPortBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricConfigResultRelationship(t *testing.T) { p := models.FabricConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricConfigResultRelationship(p, d) @@ -9583,14 +9583,14 @@ func TestFlattenMapFabricConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricEthNetworkControlPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkControlPolicyRelationship(p, d) @@ -9601,14 +9601,14 @@ func TestFlattenMapFabricEthNetworkControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkGroupPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkGroupPolicyRelationship(p, d) @@ -9619,14 +9619,14 @@ func TestFlattenMapFabricEthNetworkGroupPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkGroupPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricEthNetworkPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkPolicyRelationship(p, d) @@ -9637,14 +9637,14 @@ func TestFlattenMapFabricEthNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricFcNetworkPolicyRelationship(t *testing.T) { p := models.FabricFcNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricFcNetworkPolicyRelationship(p, d) @@ -9655,14 +9655,14 @@ func TestFlattenMapFabricFcNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricFcNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricFlowControlPolicyRelationship(t *testing.T) { p := models.FabricFlowControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricFlowControlPolicyRelationship(p, d) @@ -9673,7 +9673,7 @@ func TestFlattenMapFabricFlowControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricFlowControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9698,7 +9698,7 @@ func TestFlattenMapFabricLinkAggregationPolicyRelationship(t *testing.T) { func TestFlattenMapFabricLinkControlPolicyRelationship(t *testing.T) { p := models.FabricLinkControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricLinkControlPolicyRelationship(p, d) @@ -9709,14 +9709,14 @@ func TestFlattenMapFabricLinkControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricLinkControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricLldpSettings(t *testing.T) { p := models.FabricLldpSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"fabric.LldpSettings","ReceiveEnabled":true,"TransmitEnabled":true,"ClassId":"fabric.LldpSettings"}` + c := `{"ClassId":"fabric.LldpSettings","ObjectType":"fabric.LldpSettings","ReceiveEnabled":true,"TransmitEnabled":true}` //test when the response is empty ffOpEmpty := flattenMapFabricLldpSettings(p, d) @@ -9727,7 +9727,7 @@ func TestFlattenMapFabricLldpSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricLldpSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "fabric.LldpSettings", "receive_enabled": true, "transmit_enabled": true, "class_id": "fabric.LldpSettings"} + expectedOp := map[string]interface{}{"class_id": "fabric.LldpSettings", "object_type": "fabric.LldpSettings", "receive_enabled": true, "transmit_enabled": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9752,7 +9752,7 @@ func TestFlattenMapFabricMacAgingSettings(t *testing.T) { func TestFlattenMapFabricMulticastPolicyRelationship(t *testing.T) { p := models.FabricMulticastPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricMulticastPolicyRelationship(p, d) @@ -9763,14 +9763,14 @@ func TestFlattenMapFabricMulticastPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricMulticastPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricPortPolicyRelationship(t *testing.T) { p := models.FabricPortPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricPortPolicyRelationship(p, d) @@ -9781,14 +9781,14 @@ func TestFlattenMapFabricPortPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricPortPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricSwitchClusterProfileRelationship(t *testing.T) { p := models.FabricSwitchClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricSwitchClusterProfileRelationship(p, d) @@ -9799,14 +9799,14 @@ func TestFlattenMapFabricSwitchClusterProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricSwitchClusterProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricSwitchProfileRelationship(t *testing.T) { p := models.FabricSwitchProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricSwitchProfileRelationship(p, d) @@ -9817,14 +9817,14 @@ func TestFlattenMapFabricSwitchProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricSwitchProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricUdldGlobalSettings(t *testing.T) { p := models.FabricUdldGlobalSettings{} var d = &schema.ResourceData{} - c := `{"MessageInterval":32,"RecoveryAction":"RecoveryAction %d","ClassId":"fabric.UdldGlobalSettings","ObjectType":"fabric.UdldGlobalSettings"}` + c := `{"ObjectType":"fabric.UdldGlobalSettings","MessageInterval":32,"RecoveryAction":"RecoveryAction %d","ClassId":"fabric.UdldGlobalSettings"}` //test when the response is empty ffOpEmpty := flattenMapFabricUdldGlobalSettings(p, d) @@ -9835,7 +9835,7 @@ func TestFlattenMapFabricUdldGlobalSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricUdldGlobalSettings(p, d)[0] - expectedOp := map[string]interface{}{"message_interval": 32, "recovery_action": "RecoveryAction 1", "class_id": "fabric.UdldGlobalSettings", "object_type": "fabric.UdldGlobalSettings"} + expectedOp := map[string]interface{}{"object_type": "fabric.UdldGlobalSettings", "message_interval": 32, "recovery_action": "RecoveryAction 1", "class_id": "fabric.UdldGlobalSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9860,7 +9860,7 @@ func TestFlattenMapFabricUdldSettings(t *testing.T) { func TestFlattenMapFabricVlanSettings(t *testing.T) { p := models.FabricVlanSettings{} var d = &schema.ResourceData{} - c := `{"AllowedVlans":"AllowedVlans %d","NativeVlan":32,"ClassId":"fabric.VlanSettings","ObjectType":"fabric.VlanSettings"}` + c := `{"ClassId":"fabric.VlanSettings","ObjectType":"fabric.VlanSettings","AllowedVlans":"AllowedVlans %d","NativeVlan":32}` //test when the response is empty ffOpEmpty := flattenMapFabricVlanSettings(p, d) @@ -9871,14 +9871,14 @@ func TestFlattenMapFabricVlanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricVlanSettings(p, d)[0] - expectedOp := map[string]interface{}{"allowed_vlans": "AllowedVlans 1", "native_vlan": 32, "class_id": "fabric.VlanSettings", "object_type": "fabric.VlanSettings"} + expectedOp := map[string]interface{}{"class_id": "fabric.VlanSettings", "object_type": "fabric.VlanSettings", "allowed_vlans": "AllowedVlans 1", "native_vlan": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolBlock(t *testing.T) { p := models.FcpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"fcpool.Block","ObjectType":"fcpool.Block","Size":32,"From":"From %d","To":"To %d"}` + c := `{"To":"To %d","ClassId":"fcpool.Block","ObjectType":"fcpool.Block","Size":32,"From":"From %d"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolBlock(p, d) @@ -9889,14 +9889,14 @@ func TestFlattenMapFcpoolBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolBlock(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "fcpool.Block", "object_type": "fcpool.Block", "size": 32, "from": "From 1", "to": "To 1"} + expectedOp := map[string]interface{}{"to": "To 1", "class_id": "fcpool.Block", "object_type": "fcpool.Block", "size": 32, "from": "From 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolFcBlockRelationship(t *testing.T) { p := models.FcpoolFcBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolFcBlockRelationship(p, d) @@ -9907,7 +9907,7 @@ func TestFlattenMapFcpoolFcBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolFcBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9932,7 +9932,7 @@ func TestFlattenMapFcpoolLeaseRelationship(t *testing.T) { func TestFlattenMapFcpoolPoolRelationship(t *testing.T) { p := models.FcpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolPoolRelationship(p, d) @@ -9943,14 +9943,14 @@ func TestFlattenMapFcpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolPoolMemberRelationship(t *testing.T) { p := models.FcpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolPoolMemberRelationship(p, d) @@ -9961,14 +9961,14 @@ func TestFlattenMapFcpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolUniverseRelationship(t *testing.T) { p := models.FcpoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolUniverseRelationship(p, d) @@ -9979,14 +9979,14 @@ func TestFlattenMapFcpoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareBaseDistributableRelationship(t *testing.T) { p := models.FirmwareBaseDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareBaseDistributableRelationship(p, d) @@ -9997,14 +9997,14 @@ func TestFlattenMapFirmwareBaseDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareBaseDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareDirectDownload(t *testing.T) { p := models.FirmwareDirectDownload{} var d = &schema.ResourceData{} - c := `{"ImageSource":"ImageSource %d","Username":"Username %d","Upgradeoption":"Upgradeoption %d","ClassId":"firmware.DirectDownload","ObjectType":"firmware.DirectDownload","IsPasswordSet":true}` + c := `{"IsPasswordSet":true,"ObjectType":"firmware.DirectDownload","Upgradeoption":"Upgradeoption %d","Username":"Username %d","ImageSource":"ImageSource %d","ClassId":"firmware.DirectDownload"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareDirectDownload(p, d) @@ -10015,14 +10015,14 @@ func TestFlattenMapFirmwareDirectDownload(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareDirectDownload(p, d)[0] - expectedOp := map[string]interface{}{"image_source": "ImageSource 1", "username": "Username 1", "upgradeoption": "Upgradeoption 1", "class_id": "firmware.DirectDownload", "object_type": "firmware.DirectDownload", "is_password_set": true} + expectedOp := map[string]interface{}{"is_password_set": true, "object_type": "firmware.DirectDownload", "upgradeoption": "Upgradeoption 1", "username": "Username 1", "image_source": "ImageSource 1", "class_id": "firmware.DirectDownload"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareDistributableRelationship(t *testing.T) { p := models.FirmwareDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareDistributableRelationship(p, d) @@ -10033,14 +10033,14 @@ func TestFlattenMapFirmwareDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareNetworkShare(t *testing.T) { p := models.FirmwareNetworkShare{} var d = &schema.ResourceData{} - c := `{"ClassId":"firmware.NetworkShare","ObjectType":"firmware.NetworkShare","MapType":"MapType %d","Username":"Username %d","Upgradeoption":"Upgradeoption %d","IsPasswordSet":true}` + c := `{"ObjectType":"firmware.NetworkShare","MapType":"MapType %d","ClassId":"firmware.NetworkShare","Username":"Username %d","IsPasswordSet":true,"Upgradeoption":"Upgradeoption %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareNetworkShare(p, d) @@ -10051,14 +10051,14 @@ func TestFlattenMapFirmwareNetworkShare(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareNetworkShare(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "firmware.NetworkShare", "object_type": "firmware.NetworkShare", "map_type": "MapType 1", "username": "Username 1", "upgradeoption": "Upgradeoption 1", "is_password_set": true} + expectedOp := map[string]interface{}{"object_type": "firmware.NetworkShare", "map_type": "MapType 1", "class_id": "firmware.NetworkShare", "username": "Username 1", "is_password_set": true, "upgradeoption": "Upgradeoption 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareRunningFirmwareRelationship(t *testing.T) { p := models.FirmwareRunningFirmwareRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareRunningFirmwareRelationship(p, d) @@ -10069,7 +10069,7 @@ func TestFlattenMapFirmwareRunningFirmwareRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareRunningFirmwareRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10112,7 +10112,7 @@ func TestFlattenMapFirmwareUpgradeBaseRelationship(t *testing.T) { func TestFlattenMapFirmwareUpgradeImpactStatusRelationship(t *testing.T) { p := models.FirmwareUpgradeImpactStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareUpgradeImpactStatusRelationship(p, d) @@ -10123,7 +10123,7 @@ func TestFlattenMapFirmwareUpgradeImpactStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareUpgradeImpactStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10148,7 +10148,7 @@ func TestFlattenMapFirmwareUpgradeStatusRelationship(t *testing.T) { func TestFlattenMapForecastCatalogRelationship(t *testing.T) { p := models.ForecastCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapForecastCatalogRelationship(p, d) @@ -10159,14 +10159,14 @@ func TestFlattenMapForecastCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapForecastDefinitionRelationship(t *testing.T) { p := models.ForecastDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapForecastDefinitionRelationship(p, d) @@ -10177,14 +10177,14 @@ func TestFlattenMapForecastDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapForecastInstanceRelationship(t *testing.T) { p := models.ForecastInstanceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapForecastInstanceRelationship(p, d) @@ -10195,14 +10195,14 @@ func TestFlattenMapForecastInstanceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastInstanceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapForecastModel(t *testing.T) { p := models.ForecastModel{} var d = &schema.ResourceData{} - c := `{"ClassId":"forecast.Model","ObjectType":"forecast.Model","Accuracy":32.000000,"ModelType":"ModelType %d"}` + c := `{"Accuracy":32.000000,"ModelType":"ModelType %d","ClassId":"forecast.Model","ObjectType":"forecast.Model"}` //test when the response is empty ffOpEmpty := flattenMapForecastModel(p, d) @@ -10213,7 +10213,7 @@ func TestFlattenMapForecastModel(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastModel(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "forecast.Model", "object_type": "forecast.Model", "accuracy": 32.000000, "model_type": "ModelType 1"} + expectedOp := map[string]interface{}{"accuracy": 32.000000, "model_type": "ModelType 1", "class_id": "forecast.Model", "object_type": "forecast.Model"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10238,7 +10238,7 @@ func TestFlattenMapGraphicsCardRelationship(t *testing.T) { func TestFlattenMapHclOperatingSystemRelationship(t *testing.T) { p := models.HclOperatingSystemRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHclOperatingSystemRelationship(p, d) @@ -10249,7 +10249,7 @@ func TestFlattenMapHclOperatingSystemRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHclOperatingSystemRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10274,7 +10274,7 @@ func TestFlattenMapHclOperatingSystemVendorRelationship(t *testing.T) { func TestFlattenMapHyperflexAlarmSummary(t *testing.T) { p := models.HyperflexAlarmSummary{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.AlarmSummary","Critical":32,"Warning":32,"ClassId":"hyperflex.AlarmSummary"}` + c := `{"Critical":32,"ObjectType":"hyperflex.AlarmSummary","ClassId":"hyperflex.AlarmSummary","Warning":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAlarmSummary(p, d) @@ -10285,7 +10285,7 @@ func TestFlattenMapHyperflexAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.AlarmSummary", "critical": 32, "warning": 32, "class_id": "hyperflex.AlarmSummary"} + expectedOp := map[string]interface{}{"critical": 32, "object_type": "hyperflex.AlarmSummary", "class_id": "hyperflex.AlarmSummary", "warning": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10310,7 +10310,7 @@ func TestFlattenMapHyperflexAppCatalogRelationship(t *testing.T) { func TestFlattenMapHyperflexAppSettingConstraint(t *testing.T) { p := models.HyperflexAppSettingConstraint{} var d = &schema.ResourceData{} - c := `{"ServerModel":"ServerModel %d","DeploymentType":"DeploymentType %d","ClassId":"hyperflex.AppSettingConstraint","ObjectType":"hyperflex.AppSettingConstraint","HxdpVersion":"HxdpVersion %d","HypervisorType":"HypervisorType %d","MgmtPlatform":"MgmtPlatform %d"}` + c := `{"ClassId":"hyperflex.AppSettingConstraint","ObjectType":"hyperflex.AppSettingConstraint","ServerModel":"ServerModel %d","DeploymentType":"DeploymentType %d","HxdpVersion":"HxdpVersion %d","HypervisorType":"HypervisorType %d","MgmtPlatform":"MgmtPlatform %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAppSettingConstraint(p, d) @@ -10321,14 +10321,14 @@ func TestFlattenMapHyperflexAppSettingConstraint(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAppSettingConstraint(p, d)[0] - expectedOp := map[string]interface{}{"server_model": "ServerModel 1", "deployment_type": "DeploymentType 1", "class_id": "hyperflex.AppSettingConstraint", "object_type": "hyperflex.AppSettingConstraint", "hxdp_version": "HxdpVersion 1", "hypervisor_type": "HypervisorType 1", "mgmt_platform": "MgmtPlatform 1"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.AppSettingConstraint", "object_type": "hyperflex.AppSettingConstraint", "server_model": "ServerModel 1", "deployment_type": "DeploymentType 1", "hxdp_version": "HxdpVersion 1", "hypervisor_type": "HypervisorType 1", "mgmt_platform": "MgmtPlatform 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexAutoSupportPolicyRelationship(t *testing.T) { p := models.HyperflexAutoSupportPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAutoSupportPolicyRelationship(p, d) @@ -10339,14 +10339,14 @@ func TestFlattenMapHyperflexAutoSupportPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAutoSupportPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexBackupClusterRelationship(t *testing.T) { p := models.HyperflexBackupClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexBackupClusterRelationship(p, d) @@ -10357,14 +10357,14 @@ func TestFlattenMapHyperflexBackupClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexBackupClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexBaseClusterRelationship(t *testing.T) { p := models.HyperflexBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexBaseClusterRelationship(p, d) @@ -10375,14 +10375,14 @@ func TestFlattenMapHyperflexBaseClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexBaseClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexBondState(t *testing.T) { p := models.HyperflexBondState{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.BondState","ClassId":"hyperflex.BondState","ActiveSlave":"ActiveSlave %d","Mode":"Mode %d"}` + c := `{"Mode":"Mode %d","ActiveSlave":"ActiveSlave %d","ObjectType":"hyperflex.BondState","ClassId":"hyperflex.BondState"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexBondState(p, d) @@ -10393,14 +10393,14 @@ func TestFlattenMapHyperflexBondState(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexBondState(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.BondState", "class_id": "hyperflex.BondState", "active_slave": "ActiveSlave 1", "mode": "Mode 1"} + expectedOp := map[string]interface{}{"mode": "Mode 1", "active_slave": "ActiveSlave 1", "object_type": "hyperflex.BondState", "class_id": "hyperflex.BondState"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexCiscoHypervisorManagerRelationship(t *testing.T) { p := models.HyperflexCiscoHypervisorManagerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexCiscoHypervisorManagerRelationship(p, d) @@ -10411,14 +10411,14 @@ func TestFlattenMapHyperflexCiscoHypervisorManagerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexCiscoHypervisorManagerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterRelationship(t *testing.T) { p := models.HyperflexClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterRelationship(p, d) @@ -10429,14 +10429,14 @@ func TestFlattenMapHyperflexClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterNetworkPolicyRelationship(t *testing.T) { p := models.HyperflexClusterNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterNetworkPolicyRelationship(p, d) @@ -10447,14 +10447,14 @@ func TestFlattenMapHyperflexClusterNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterProfileRelationship(t *testing.T) { p := models.HyperflexClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterProfileRelationship(p, d) @@ -10465,14 +10465,14 @@ func TestFlattenMapHyperflexClusterProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterStoragePolicyRelationship(t *testing.T) { p := models.HyperflexClusterStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterStoragePolicyRelationship(p, d) @@ -10483,14 +10483,14 @@ func TestFlattenMapHyperflexClusterStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexConfigResultRelationship(t *testing.T) { p := models.HyperflexConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexConfigResultRelationship(p, d) @@ -10501,14 +10501,14 @@ func TestFlattenMapHyperflexConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexDataProtectionPeerRelationship(t *testing.T) { p := models.HyperflexDataProtectionPeerRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexDataProtectionPeerRelationship(p, d) @@ -10519,14 +10519,14 @@ func TestFlattenMapHyperflexDataProtectionPeerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexDataProtectionPeerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexDiskStatus(t *testing.T) { p := models.HyperflexDiskStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.DiskStatus","ClassId":"hyperflex.DiskStatus","DownloadPercentage":"DownloadPercentage %d","State":"State %d","VolumeHandle":"VolumeHandle %d","VolumeName":"VolumeName %d"}` + c := `{"ClassId":"hyperflex.DiskStatus","DownloadPercentage":"DownloadPercentage %d","State":"State %d","VolumeHandle":"VolumeHandle %d","VolumeName":"VolumeName %d","ObjectType":"hyperflex.DiskStatus"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexDiskStatus(p, d) @@ -10537,14 +10537,14 @@ func TestFlattenMapHyperflexDiskStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexDiskStatus(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.DiskStatus", "class_id": "hyperflex.DiskStatus", "download_percentage": "DownloadPercentage 1", "state": "State 1", "volume_handle": "VolumeHandle 1", "volume_name": "VolumeName 1"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.DiskStatus", "download_percentage": "DownloadPercentage 1", "state": "State 1", "volume_handle": "VolumeHandle 1", "volume_name": "VolumeName 1", "object_type": "hyperflex.DiskStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexEntityReference(t *testing.T) { p := models.HyperflexEntityReference{} var d = &schema.ResourceData{} - c := `{"Id":"Id %d","Idtype":"Idtype %d","Name":"Name %d","Type":"Type %d","ClassId":"hyperflex.EntityReference","ObjectType":"hyperflex.EntityReference","Confignum":32}` + c := `{"ObjectType":"hyperflex.EntityReference","Id":"Id %d","Idtype":"Idtype %d","Name":"Name %d","Type":"Type %d","Confignum":32,"ClassId":"hyperflex.EntityReference"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexEntityReference(p, d) @@ -10555,14 +10555,14 @@ func TestFlattenMapHyperflexEntityReference(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexEntityReference(p, d)[0] - expectedOp := map[string]interface{}{"id": "Id 1", "idtype": "Idtype 1", "name": "Name 1", "type": "Type 1", "class_id": "hyperflex.EntityReference", "object_type": "hyperflex.EntityReference", "confignum": 32} + expectedOp := map[string]interface{}{"object_type": "hyperflex.EntityReference", "id": "Id 1", "idtype": "Idtype 1", "name": "Name 1", "type": "Type 1", "confignum": 32, "class_id": "hyperflex.EntityReference"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexErrorStack(t *testing.T) { p := models.HyperflexErrorStack{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.ErrorStack","Message":"Message %d","MessageId":32,"ClassId":"hyperflex.ErrorStack"}` + c := `{"ObjectType":"hyperflex.ErrorStack","ClassId":"hyperflex.ErrorStack","Message":"Message %d","MessageId":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexErrorStack(p, d) @@ -10573,14 +10573,14 @@ func TestFlattenMapHyperflexErrorStack(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexErrorStack(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.ErrorStack", "message": "Message 1", "message_id": 32, "class_id": "hyperflex.ErrorStack"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.ErrorStack", "class_id": "hyperflex.ErrorStack", "message": "Message 1", "message_id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexExtFcStoragePolicyRelationship(t *testing.T) { p := models.HyperflexExtFcStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexExtFcStoragePolicyRelationship(p, d) @@ -10591,14 +10591,14 @@ func TestFlattenMapHyperflexExtFcStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexExtFcStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexExtIscsiStoragePolicyRelationship(t *testing.T) { p := models.HyperflexExtIscsiStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexExtIscsiStoragePolicyRelationship(p, d) @@ -10609,14 +10609,14 @@ func TestFlattenMapHyperflexExtIscsiStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexExtIscsiStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexFeatureLimitExternalRelationship(t *testing.T) { p := models.HyperflexFeatureLimitExternalRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexFeatureLimitExternalRelationship(p, d) @@ -10627,7 +10627,7 @@ func TestFlattenMapHyperflexFeatureLimitExternalRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexFeatureLimitExternalRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10652,7 +10652,7 @@ func TestFlattenMapHyperflexFeatureLimitInternalRelationship(t *testing.T) { func TestFlattenMapHyperflexHealthRelationship(t *testing.T) { p := models.HyperflexHealthRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthRelationship(p, d) @@ -10663,14 +10663,14 @@ func TestFlattenMapHyperflexHealthRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHealthCheckDefinitionRelationship(t *testing.T) { p := models.HyperflexHealthCheckDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthCheckDefinitionRelationship(p, d) @@ -10681,14 +10681,14 @@ func TestFlattenMapHyperflexHealthCheckDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthCheckDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHealthCheckScriptInfo(t *testing.T) { p := models.HyperflexHealthCheckScriptInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.HealthCheckScriptInfo","ScriptInput":"ScriptInput %d","AggregateScriptName":"AggregateScriptName %d","HyperflexVersion":"HyperflexVersion %d","ClassId":"hyperflex.HealthCheckScriptInfo","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptName":"ScriptName %d","Version":"Version %d"}` + c := `{"ObjectType":"hyperflex.HealthCheckScriptInfo","AggregateScriptName":"AggregateScriptName %d","Version":"Version %d","ClassId":"hyperflex.HealthCheckScriptInfo","HyperflexVersion":"HyperflexVersion %d","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptInput":"ScriptInput %d","ScriptName":"ScriptName %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthCheckScriptInfo(p, d) @@ -10699,14 +10699,14 @@ func TestFlattenMapHyperflexHealthCheckScriptInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthCheckScriptInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 1", "aggregate_script_name": "AggregateScriptName 1", "hyperflex_version": "HyperflexVersion 1", "class_id": "hyperflex.HealthCheckScriptInfo", "script_execute_location": "ScriptExecuteLocation 1", "script_name": "ScriptName 1", "nr_version": "Version 1"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 1", "nr_version": "Version 1", "class_id": "hyperflex.HealthCheckScriptInfo", "hyperflex_version": "HyperflexVersion 1", "script_execute_location": "ScriptExecuteLocation 1", "script_input": "ScriptInput 1", "script_name": "ScriptName 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxLicenseAuthorizationDetailsDt(t *testing.T) { p := models.HyperflexHxLicenseAuthorizationDetailsDt{} var d = &schema.ResourceData{} - c := `{"Status":"Status %d","CommunicationDeadlineDate":"CommunicationDeadlineDate %d","EvaluationPeriodExpiredAt":"EvaluationPeriodExpiredAt %d","EvaluationPeriodRemaining":"EvaluationPeriodRemaining %d","NextCommunicationAttemptDate":"NextCommunicationAttemptDate %d","ObjectType":"hyperflex.HxLicenseAuthorizationDetailsDt","ClassId":"hyperflex.HxLicenseAuthorizationDetailsDt","LastCommunicationAttemptDate":"LastCommunicationAttemptDate %d"}` + c := `{"ObjectType":"hyperflex.HxLicenseAuthorizationDetailsDt","NextCommunicationAttemptDate":"NextCommunicationAttemptDate %d","Status":"Status %d","CommunicationDeadlineDate":"CommunicationDeadlineDate %d","EvaluationPeriodExpiredAt":"EvaluationPeriodExpiredAt %d","ClassId":"hyperflex.HxLicenseAuthorizationDetailsDt","LastCommunicationAttemptDate":"LastCommunicationAttemptDate %d","EvaluationPeriodRemaining":"EvaluationPeriodRemaining %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxLicenseAuthorizationDetailsDt(p, d) @@ -10717,14 +10717,14 @@ func TestFlattenMapHyperflexHxLicenseAuthorizationDetailsDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxLicenseAuthorizationDetailsDt(p, d)[0] - expectedOp := map[string]interface{}{"status": "Status 1", "communication_deadline_date": "CommunicationDeadlineDate 1", "evaluation_period_expired_at": "EvaluationPeriodExpiredAt 1", "evaluation_period_remaining": "EvaluationPeriodRemaining 1", "next_communication_attempt_date": "NextCommunicationAttemptDate 1", "object_type": "hyperflex.HxLicenseAuthorizationDetailsDt", "class_id": "hyperflex.HxLicenseAuthorizationDetailsDt", "last_communication_attempt_date": "LastCommunicationAttemptDate 1"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.HxLicenseAuthorizationDetailsDt", "next_communication_attempt_date": "NextCommunicationAttemptDate 1", "status": "Status 1", "communication_deadline_date": "CommunicationDeadlineDate 1", "evaluation_period_expired_at": "EvaluationPeriodExpiredAt 1", "class_id": "hyperflex.HxLicenseAuthorizationDetailsDt", "last_communication_attempt_date": "LastCommunicationAttemptDate 1", "evaluation_period_remaining": "EvaluationPeriodRemaining 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxNetworkAddressDt(t *testing.T) { p := models.HyperflexHxNetworkAddressDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxNetworkAddressDt","ObjectType":"hyperflex.HxNetworkAddressDt","Ip":"Ip %d","Address":"Address %d","Fqdn":"Fqdn %d"}` + c := `{"Ip":"Ip %d","ClassId":"hyperflex.HxNetworkAddressDt","ObjectType":"hyperflex.HxNetworkAddressDt","Address":"Address %d","Fqdn":"Fqdn %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxNetworkAddressDt(p, d) @@ -10735,14 +10735,14 @@ func TestFlattenMapHyperflexHxNetworkAddressDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxNetworkAddressDt(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "hyperflex.HxNetworkAddressDt", "object_type": "hyperflex.HxNetworkAddressDt", "ip": "Ip 1", "address": "Address 1", "fqdn": "Fqdn 1"} + expectedOp := map[string]interface{}{"ip": "Ip 1", "class_id": "hyperflex.HxNetworkAddressDt", "object_type": "hyperflex.HxNetworkAddressDt", "address": "Address 1", "fqdn": "Fqdn 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxPlatformDatastoreConfigDt(t *testing.T) { p := models.HyperflexHxPlatformDatastoreConfigDt{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","NumMirrors":32,"DataBlockSize":32,"NumStripesForLargeFiles":32,"ProvisionedCapacity":32,"SystemDatastore":true,"ClassId":"hyperflex.HxPlatformDatastoreConfigDt","ObjectType":"hyperflex.HxPlatformDatastoreConfigDt"}` + c := `{"Name":"Name %d","ProvisionedCapacity":32,"SystemDatastore":true,"ClassId":"hyperflex.HxPlatformDatastoreConfigDt","ObjectType":"hyperflex.HxPlatformDatastoreConfigDt","NumMirrors":32,"NumStripesForLargeFiles":32,"DataBlockSize":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxPlatformDatastoreConfigDt(p, d) @@ -10753,14 +10753,14 @@ func TestFlattenMapHyperflexHxPlatformDatastoreConfigDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxPlatformDatastoreConfigDt(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "num_mirrors": 32, "data_block_size": 32, "num_stripes_for_large_files": 32, "provisioned_capacity": 32, "system_datastore": true, "class_id": "hyperflex.HxPlatformDatastoreConfigDt", "object_type": "hyperflex.HxPlatformDatastoreConfigDt"} + expectedOp := map[string]interface{}{"name": "Name 1", "provisioned_capacity": 32, "system_datastore": true, "class_id": "hyperflex.HxPlatformDatastoreConfigDt", "object_type": "hyperflex.HxPlatformDatastoreConfigDt", "num_mirrors": 32, "num_stripes_for_large_files": 32, "data_block_size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxRegistrationDetailsDt(t *testing.T) { p := models.HyperflexHxRegistrationDetailsDt{} var d = &schema.ResourceData{} - c := `{"NextRenewalAttemptDate":"NextRenewalAttemptDate %d","ObjectType":"hyperflex.HxRegistrationDetailsDt","OutOfComplianceStartDate":"OutOfComplianceStartDate %d","RegistrationFailedReason":"RegistrationFailedReason %d","SmartAccount":"SmartAccount %d","LastRenewalAttemptDate":"LastRenewalAttemptDate %d","InitialRegistrationDate":"InitialRegistrationDate %d","ClassId":"hyperflex.HxRegistrationDetailsDt","RegistrationExpireDate":"RegistrationExpireDate %d","VirtualAccount":"VirtualAccount %d","Status":"Status %d"}` + c := `{"ClassId":"hyperflex.HxRegistrationDetailsDt","ObjectType":"hyperflex.HxRegistrationDetailsDt","RegistrationFailedReason":"RegistrationFailedReason %d","SmartAccount":"SmartAccount %d","Status":"Status %d","VirtualAccount":"VirtualAccount %d","RegistrationExpireDate":"RegistrationExpireDate %d","NextRenewalAttemptDate":"NextRenewalAttemptDate %d","OutOfComplianceStartDate":"OutOfComplianceStartDate %d","InitialRegistrationDate":"InitialRegistrationDate %d","LastRenewalAttemptDate":"LastRenewalAttemptDate %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxRegistrationDetailsDt(p, d) @@ -10771,14 +10771,14 @@ func TestFlattenMapHyperflexHxRegistrationDetailsDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxRegistrationDetailsDt(p, d)[0] - expectedOp := map[string]interface{}{"next_renewal_attempt_date": "NextRenewalAttemptDate 1", "object_type": "hyperflex.HxRegistrationDetailsDt", "out_of_compliance_start_date": "OutOfComplianceStartDate 1", "registration_failed_reason": "RegistrationFailedReason 1", "smart_account": "SmartAccount 1", "last_renewal_attempt_date": "LastRenewalAttemptDate 1", "initial_registration_date": "InitialRegistrationDate 1", "class_id": "hyperflex.HxRegistrationDetailsDt", "registration_expire_date": "RegistrationExpireDate 1", "virtual_account": "VirtualAccount 1", "status": "Status 1"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.HxRegistrationDetailsDt", "object_type": "hyperflex.HxRegistrationDetailsDt", "registration_failed_reason": "RegistrationFailedReason 1", "smart_account": "SmartAccount 1", "status": "Status 1", "virtual_account": "VirtualAccount 1", "registration_expire_date": "RegistrationExpireDate 1", "next_renewal_attempt_date": "NextRenewalAttemptDate 1", "out_of_compliance_start_date": "OutOfComplianceStartDate 1", "initial_registration_date": "InitialRegistrationDate 1", "last_renewal_attempt_date": "LastRenewalAttemptDate 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxResiliencyInfoDt(t *testing.T) { p := models.HyperflexHxResiliencyInfoDt{} var d = &schema.ResourceData{} - c := `{"HddFailuresTolerable":32,"NodeFailuresTolerable":32,"ObjectType":"hyperflex.HxResiliencyInfoDt","PolicyCompliance":"PolicyCompliance %d","ResiliencyState":"ResiliencyState %d","SsdFailuresTolerable":32,"DataReplicationFactor":"DataReplicationFactor %d","ClassId":"hyperflex.HxResiliencyInfoDt"}` + c := `{"PolicyCompliance":"PolicyCompliance %d","DataReplicationFactor":"DataReplicationFactor %d","SsdFailuresTolerable":32,"ClassId":"hyperflex.HxResiliencyInfoDt","ObjectType":"hyperflex.HxResiliencyInfoDt","NodeFailuresTolerable":32,"HddFailuresTolerable":32,"ResiliencyState":"ResiliencyState %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxResiliencyInfoDt(p, d) @@ -10789,14 +10789,14 @@ func TestFlattenMapHyperflexHxResiliencyInfoDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxResiliencyInfoDt(p, d)[0] - expectedOp := map[string]interface{}{"hdd_failures_tolerable": 32, "node_failures_tolerable": 32, "object_type": "hyperflex.HxResiliencyInfoDt", "policy_compliance": "PolicyCompliance 1", "resiliency_state": "ResiliencyState 1", "ssd_failures_tolerable": 32, "data_replication_factor": "DataReplicationFactor 1", "class_id": "hyperflex.HxResiliencyInfoDt"} + expectedOp := map[string]interface{}{"policy_compliance": "PolicyCompliance 1", "data_replication_factor": "DataReplicationFactor 1", "ssd_failures_tolerable": 32, "class_id": "hyperflex.HxResiliencyInfoDt", "object_type": "hyperflex.HxResiliencyInfoDt", "node_failures_tolerable": 32, "hdd_failures_tolerable": 32, "resiliency_state": "ResiliencyState 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxSiteDt(t *testing.T) { p := models.HyperflexHxSiteDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxSiteDt","ObjectType":"hyperflex.HxSiteDt","Name":"Name %d"}` + c := `{"Name":"Name %d","ClassId":"hyperflex.HxSiteDt","ObjectType":"hyperflex.HxSiteDt"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxSiteDt(p, d) @@ -10807,7 +10807,7 @@ func TestFlattenMapHyperflexHxSiteDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxSiteDt(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "hyperflex.HxSiteDt", "object_type": "hyperflex.HxSiteDt", "name": "Name 1"} + expectedOp := map[string]interface{}{"name": "Name 1", "class_id": "hyperflex.HxSiteDt", "object_type": "hyperflex.HxSiteDt"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10850,7 +10850,7 @@ func TestFlattenMapHyperflexHxapClusterRelationship(t *testing.T) { func TestFlattenMapHyperflexHxapDvUplinkRelationship(t *testing.T) { p := models.HyperflexHxapDvUplinkRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxapDvUplinkRelationship(p, d) @@ -10861,7 +10861,7 @@ func TestFlattenMapHyperflexHxapDvUplinkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxapDvUplinkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10886,7 +10886,7 @@ func TestFlattenMapHyperflexHxapDvswitchRelationship(t *testing.T) { func TestFlattenMapHyperflexHxapHostRelationship(t *testing.T) { p := models.HyperflexHxapHostRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxapHostRelationship(p, d) @@ -10897,14 +10897,14 @@ func TestFlattenMapHyperflexHxapHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxapHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxapNetworkRelationship(t *testing.T) { p := models.HyperflexHxapNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxapNetworkRelationship(p, d) @@ -10915,14 +10915,14 @@ func TestFlattenMapHyperflexHxapNetworkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxapNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxapVirtualDiskRelationship(t *testing.T) { p := models.HyperflexHxapVirtualDiskRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxapVirtualDiskRelationship(p, d) @@ -10933,14 +10933,14 @@ func TestFlattenMapHyperflexHxapVirtualDiskRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxapVirtualDiskRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxapVirtualMachineRelationship(t *testing.T) { p := models.HyperflexHxapVirtualMachineRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxapVirtualMachineRelationship(p, d) @@ -10951,14 +10951,14 @@ func TestFlattenMapHyperflexHxapVirtualMachineRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxapVirtualMachineRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexIpAddrRange(t *testing.T) { p := models.HyperflexIpAddrRange{} var d = &schema.ResourceData{} - c := `{"EndAddr":"EndAddr %d","Gateway":"Gateway %d","ClassId":"hyperflex.IpAddrRange","ObjectType":"hyperflex.IpAddrRange","Netmask":"Netmask %d","StartAddr":"StartAddr %d"}` + c := `{"Netmask":"Netmask %d","StartAddr":"StartAddr %d","ClassId":"hyperflex.IpAddrRange","ObjectType":"hyperflex.IpAddrRange","EndAddr":"EndAddr %d","Gateway":"Gateway %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexIpAddrRange(p, d) @@ -10969,14 +10969,14 @@ func TestFlattenMapHyperflexIpAddrRange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexIpAddrRange(p, d)[0] - expectedOp := map[string]interface{}{"end_addr": "EndAddr 1", "gateway": "Gateway 1", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "netmask": "Netmask 1", "start_addr": "StartAddr 1"} + expectedOp := map[string]interface{}{"netmask": "Netmask 1", "start_addr": "StartAddr 1", "class_id": "hyperflex.IpAddrRange", "object_type": "hyperflex.IpAddrRange", "end_addr": "EndAddr 1", "gateway": "Gateway 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexLicenseRelationship(t *testing.T) { p := models.HyperflexLicenseRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexLicenseRelationship(p, d) @@ -10987,7 +10987,7 @@ func TestFlattenMapHyperflexLicenseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexLicenseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11012,7 +11012,7 @@ func TestFlattenMapHyperflexLocalCredentialPolicyRelationship(t *testing.T) { func TestFlattenMapHyperflexLogicalAvailabilityZone(t *testing.T) { p := models.HyperflexLogicalAvailabilityZone{} var d = &schema.ResourceData{} - c := `{"AutoConfig":true,"ClassId":"hyperflex.LogicalAvailabilityZone","ObjectType":"hyperflex.LogicalAvailabilityZone"}` + c := `{"AutoConfig":true,"ObjectType":"hyperflex.LogicalAvailabilityZone","ClassId":"hyperflex.LogicalAvailabilityZone"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexLogicalAvailabilityZone(p, d) @@ -11023,7 +11023,7 @@ func TestFlattenMapHyperflexLogicalAvailabilityZone(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexLogicalAvailabilityZone(p, d)[0] - expectedOp := map[string]interface{}{"auto_config": true, "class_id": "hyperflex.LogicalAvailabilityZone", "object_type": "hyperflex.LogicalAvailabilityZone"} + expectedOp := map[string]interface{}{"auto_config": true, "object_type": "hyperflex.LogicalAvailabilityZone", "class_id": "hyperflex.LogicalAvailabilityZone"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11066,7 +11066,7 @@ func TestFlattenMapHyperflexNamedVlan(t *testing.T) { func TestFlattenMapHyperflexNamedVsan(t *testing.T) { p := models.HyperflexNamedVsan{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","VsanId":32,"ClassId":"hyperflex.NamedVsan","ObjectType":"hyperflex.NamedVsan"}` + c := `{"ClassId":"hyperflex.NamedVsan","ObjectType":"hyperflex.NamedVsan","Name":"Name %d","VsanId":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNamedVsan(p, d) @@ -11077,14 +11077,14 @@ func TestFlattenMapHyperflexNamedVsan(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNamedVsan(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "vsan_id": 32, "class_id": "hyperflex.NamedVsan", "object_type": "hyperflex.NamedVsan"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.NamedVsan", "object_type": "hyperflex.NamedVsan", "name": "Name 1", "vsan_id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexNodeRelationship(t *testing.T) { p := models.HyperflexNodeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNodeRelationship(p, d) @@ -11095,14 +11095,14 @@ func TestFlattenMapHyperflexNodeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNodeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexNodeConfigPolicyRelationship(t *testing.T) { p := models.HyperflexNodeConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNodeConfigPolicyRelationship(p, d) @@ -11113,14 +11113,14 @@ func TestFlattenMapHyperflexNodeConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNodeConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexProxySettingPolicyRelationship(t *testing.T) { p := models.HyperflexProxySettingPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexProxySettingPolicyRelationship(p, d) @@ -11131,14 +11131,14 @@ func TestFlattenMapHyperflexProxySettingPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexProxySettingPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexReplicationPeerInfo(t *testing.T) { p := models.HyperflexReplicationPeerInfo{} var d = &schema.ResourceData{} - c := `{"Mcip":"Mcip %d","Status":"Status %d","ObjectType":"hyperflex.ReplicationPeerInfo","StatusDetails":"StatusDetails %d","ClassId":"hyperflex.ReplicationPeerInfo","ReplCip":"ReplCip %d","Dcip":"Dcip %d"}` + c := `{"ClassId":"hyperflex.ReplicationPeerInfo","ReplCip":"ReplCip %d","Status":"Status %d","Mcip":"Mcip %d","ObjectType":"hyperflex.ReplicationPeerInfo","StatusDetails":"StatusDetails %d","Dcip":"Dcip %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexReplicationPeerInfo(p, d) @@ -11149,7 +11149,7 @@ func TestFlattenMapHyperflexReplicationPeerInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexReplicationPeerInfo(p, d)[0] - expectedOp := map[string]interface{}{"mcip": "Mcip 1", "status": "Status 1", "object_type": "hyperflex.ReplicationPeerInfo", "status_details": "StatusDetails 1", "class_id": "hyperflex.ReplicationPeerInfo", "repl_cip": "ReplCip 1", "dcip": "Dcip 1"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.ReplicationPeerInfo", "repl_cip": "ReplCip 1", "status": "Status 1", "mcip": "Mcip 1", "object_type": "hyperflex.ReplicationPeerInfo", "status_details": "StatusDetails 1", "dcip": "Dcip 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11174,7 +11174,7 @@ func TestFlattenMapHyperflexReplicationSchedule(t *testing.T) { func TestFlattenMapHyperflexServerFirmwareVersionRelationship(t *testing.T) { p := models.HyperflexServerFirmwareVersionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexServerFirmwareVersionRelationship(p, d) @@ -11185,7 +11185,7 @@ func TestFlattenMapHyperflexServerFirmwareVersionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexServerFirmwareVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11210,7 +11210,7 @@ func TestFlattenMapHyperflexServerModelRelationship(t *testing.T) { func TestFlattenMapHyperflexSoftwareDistributionEntryRelationship(t *testing.T) { p := models.HyperflexSoftwareDistributionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSoftwareDistributionEntryRelationship(p, d) @@ -11221,14 +11221,14 @@ func TestFlattenMapHyperflexSoftwareDistributionEntryRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSoftwareDistributionEntryRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSoftwareDistributionVersionRelationship(t *testing.T) { p := models.HyperflexSoftwareDistributionVersionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSoftwareDistributionVersionRelationship(p, d) @@ -11239,7 +11239,7 @@ func TestFlattenMapHyperflexSoftwareDistributionVersionRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSoftwareDistributionVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11282,7 +11282,7 @@ func TestFlattenMapHyperflexStorageContainerRelationship(t *testing.T) { func TestFlattenMapHyperflexSummary(t *testing.T) { p := models.HyperflexSummary{} var d = &schema.ResourceData{} - c := `{"DataReplicationFactor":"DataReplicationFactor %d","Downtime":"Downtime %d","TotalCapacity":32,"FreeCapacity":32,"TotalSavings":32.000000,"ObjectType":"hyperflex.Summary","ClusterAccessPolicy":"ClusterAccessPolicy %d","DataReplicationCompliance":"DataReplicationCompliance %d","ResiliencyDetailsSize":32,"Uptime":"Uptime %d","ActiveNodes":"ActiveNodes %d","SpaceStatus":"SpaceStatus %d","ClassId":"hyperflex.Summary","Name":"Name %d","Address":"Address %d","UsedCapacity":32,"CompressionSavings":32.000000,"State":"State %d","Boottime":32,"DeduplicationSavings":32.000000}` + c := `{"SpaceStatus":"SpaceStatus %d","TotalCapacity":32,"Address":"Address %d","TotalSavings":32.000000,"Name":"Name %d","State":"State %d","Downtime":"Downtime %d","DeduplicationSavings":32.000000,"DataReplicationFactor":"DataReplicationFactor %d","ResiliencyDetailsSize":32,"ClassId":"hyperflex.Summary","ObjectType":"hyperflex.Summary","ActiveNodes":"ActiveNodes %d","FreeCapacity":32,"ClusterAccessPolicy":"ClusterAccessPolicy %d","DataReplicationCompliance":"DataReplicationCompliance %d","CompressionSavings":32.000000,"Boottime":32,"Uptime":"Uptime %d","UsedCapacity":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSummary(p, d) @@ -11293,14 +11293,14 @@ func TestFlattenMapHyperflexSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSummary(p, d)[0] - expectedOp := map[string]interface{}{"data_replication_factor": "DataReplicationFactor 1", "downtime": "Downtime 1", "total_capacity": 32, "free_capacity": 32, "total_savings": 32.000000, "object_type": "hyperflex.Summary", "cluster_access_policy": "ClusterAccessPolicy 1", "data_replication_compliance": "DataReplicationCompliance 1", "resiliency_details_size": 32, "uptime": "Uptime 1", "active_nodes": "ActiveNodes 1", "space_status": "SpaceStatus 1", "class_id": "hyperflex.Summary", "name": "Name 1", "address": "Address 1", "used_capacity": 32, "compression_savings": 32.000000, "state": "State 1", "boottime": 32, "deduplication_savings": 32.000000} + expectedOp := map[string]interface{}{"space_status": "SpaceStatus 1", "total_capacity": 32, "address": "Address 1", "total_savings": 32.000000, "name": "Name 1", "state": "State 1", "downtime": "Downtime 1", "deduplication_savings": 32.000000, "data_replication_factor": "DataReplicationFactor 1", "resiliency_details_size": 32, "class_id": "hyperflex.Summary", "object_type": "hyperflex.Summary", "active_nodes": "ActiveNodes 1", "free_capacity": 32, "cluster_access_policy": "ClusterAccessPolicy 1", "data_replication_compliance": "DataReplicationCompliance 1", "compression_savings": 32.000000, "boottime": 32, "uptime": "Uptime 1", "used_capacity": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSysConfigPolicyRelationship(t *testing.T) { p := models.HyperflexSysConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSysConfigPolicyRelationship(p, d) @@ -11311,7 +11311,7 @@ func TestFlattenMapHyperflexSysConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSysConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11354,7 +11354,7 @@ func TestFlattenMapHyperflexVcenterConfigPolicyRelationship(t *testing.T) { func TestFlattenMapHyperflexVirtualMachine(t *testing.T) { p := models.HyperflexVirtualMachine{} var d = &schema.ResourceData{} - c := `{"StatusCode":"StatusCode %d","Uuid":"Uuid %d","ClassId":"hyperflex.VirtualMachine","ObjectType":"hyperflex.VirtualMachine"}` + c := `{"ClassId":"hyperflex.VirtualMachine","ObjectType":"hyperflex.VirtualMachine","Uuid":"Uuid %d","StatusCode":"StatusCode %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVirtualMachine(p, d) @@ -11365,14 +11365,14 @@ func TestFlattenMapHyperflexVirtualMachine(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVirtualMachine(p, d)[0] - expectedOp := map[string]interface{}{"status_code": "StatusCode 1", "uuid": "Uuid 1", "class_id": "hyperflex.VirtualMachine", "object_type": "hyperflex.VirtualMachine"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.VirtualMachine", "object_type": "hyperflex.VirtualMachine", "uuid": "Uuid 1", "status_code": "StatusCode 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexVmBackupInfoRelationship(t *testing.T) { p := models.HyperflexVmBackupInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVmBackupInfoRelationship(p, d) @@ -11383,14 +11383,14 @@ func TestFlattenMapHyperflexVmBackupInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVmBackupInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexVmSnapshotInfoRelationship(t *testing.T) { p := models.HyperflexVmSnapshotInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVmSnapshotInfoRelationship(p, d) @@ -11401,14 +11401,14 @@ func TestFlattenMapHyperflexVmSnapshotInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVmSnapshotInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexWwxnPrefixRange(t *testing.T) { p := models.HyperflexWwxnPrefixRange{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.WwxnPrefixRange","EndAddr":"EndAddr %d","StartAddr":"StartAddr %d","ClassId":"hyperflex.WwxnPrefixRange"}` + c := `{"ClassId":"hyperflex.WwxnPrefixRange","ObjectType":"hyperflex.WwxnPrefixRange","EndAddr":"EndAddr %d","StartAddr":"StartAddr %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexWwxnPrefixRange(p, d) @@ -11419,14 +11419,14 @@ func TestFlattenMapHyperflexWwxnPrefixRange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexWwxnPrefixRange(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.WwxnPrefixRange", "end_addr": "EndAddr 1", "start_addr": "StartAddr 1", "class_id": "hyperflex.WwxnPrefixRange"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.WwxnPrefixRange", "object_type": "hyperflex.WwxnPrefixRange", "end_addr": "EndAddr 1", "start_addr": "StartAddr 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIaasLicenseInfoRelationship(t *testing.T) { p := models.IaasLicenseInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIaasLicenseInfoRelationship(p, d) @@ -11437,14 +11437,14 @@ func TestFlattenMapIaasLicenseInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIaasLicenseInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIaasUcsdInfoRelationship(t *testing.T) { p := models.IaasUcsdInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIaasUcsdInfoRelationship(p, d) @@ -11455,14 +11455,14 @@ func TestFlattenMapIaasUcsdInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIaasUcsdInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIaasUcsdManagedInfraRelationship(t *testing.T) { p := models.IaasUcsdManagedInfraRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIaasUcsdManagedInfraRelationship(p, d) @@ -11473,14 +11473,14 @@ func TestFlattenMapIaasUcsdManagedInfraRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIaasUcsdManagedInfraRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamAccountRelationship(t *testing.T) { p := models.IamAccountRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamAccountRelationship(p, d) @@ -11491,7 +11491,7 @@ func TestFlattenMapIamAccountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamAccountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11534,7 +11534,7 @@ func TestFlattenMapIamCertificateRelationship(t *testing.T) { func TestFlattenMapIamCertificateRequestRelationship(t *testing.T) { p := models.IamCertificateRequestRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamCertificateRequestRelationship(p, d) @@ -11545,7 +11545,7 @@ func TestFlattenMapIamCertificateRequestRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamCertificateRequestRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11570,7 +11570,7 @@ func TestFlattenMapIamClientMeta(t *testing.T) { func TestFlattenMapIamDomainGroupRelationship(t *testing.T) { p := models.IamDomainGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamDomainGroupRelationship(p, d) @@ -11581,14 +11581,14 @@ func TestFlattenMapIamDomainGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamDomainGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamEndPointPasswordProperties(t *testing.T) { p := models.IamEndPointPasswordProperties{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.EndPointPasswordProperties","EnforceStrongPassword":true,"EnablePasswordExpiry":true,"NotificationPeriod":32,"ObjectType":"iam.EndPointPasswordProperties","PasswordHistory":32,"ForceSendPassword":true,"PasswordExpiryDuration":32,"GracePeriod":32}` + c := `{"NotificationPeriod":32,"PasswordHistory":32,"PasswordExpiryDuration":32,"EnforceStrongPassword":true,"ForceSendPassword":true,"GracePeriod":32,"ObjectType":"iam.EndPointPasswordProperties","ClassId":"iam.EndPointPasswordProperties","EnablePasswordExpiry":true}` //test when the response is empty ffOpEmpty := flattenMapIamEndPointPasswordProperties(p, d) @@ -11599,7 +11599,7 @@ func TestFlattenMapIamEndPointPasswordProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamEndPointPasswordProperties(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "iam.EndPointPasswordProperties", "enforce_strong_password": true, "enable_password_expiry": true, "notification_period": 32, "object_type": "iam.EndPointPasswordProperties", "password_history": 32, "force_send_password": true, "password_expiry_duration": 32, "grace_period": 32} + expectedOp := map[string]interface{}{"notification_period": 32, "password_history": 32, "password_expiry_duration": 32, "enforce_strong_password": true, "force_send_password": true, "grace_period": 32, "object_type": "iam.EndPointPasswordProperties", "class_id": "iam.EndPointPasswordProperties", "enable_password_expiry": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11624,7 +11624,7 @@ func TestFlattenMapIamEndPointUserRelationship(t *testing.T) { func TestFlattenMapIamEndPointUserPolicyRelationship(t *testing.T) { p := models.IamEndPointUserPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamEndPointUserPolicyRelationship(p, d) @@ -11635,14 +11635,14 @@ func TestFlattenMapIamEndPointUserPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamEndPointUserPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamIdpRelationship(t *testing.T) { p := models.IamIdpRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamIdpRelationship(p, d) @@ -11653,14 +11653,14 @@ func TestFlattenMapIamIdpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamIdpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamIdpReferenceRelationship(t *testing.T) { p := models.IamIdpReferenceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamIdpReferenceRelationship(p, d) @@ -11671,14 +11671,14 @@ func TestFlattenMapIamIdpReferenceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamIdpReferenceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamIpAccessManagementRelationship(t *testing.T) { p := models.IamIpAccessManagementRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapIamIpAccessManagementRelationship(p, d) @@ -11689,14 +11689,14 @@ func TestFlattenMapIamIpAccessManagementRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamIpAccessManagementRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamLdapBaseProperties(t *testing.T) { p := models.IamLdapBaseProperties{} var d = &schema.ResourceData{} - c := `{"BindDn":"BindDn %d","BaseDn":"BaseDn %d","ClassId":"iam.LdapBaseProperties","Attribute":"Attribute %d","NestedGroupSearchDepth":32,"EnableEncryption":true,"EnableGroupAuthorization":true,"Timeout":32,"ObjectType":"iam.LdapBaseProperties","Filter":"Filter %d","GroupAttribute":"GroupAttribute %d","Domain":"Domain %d","IsPasswordSet":true,"BindMethod":"BindMethod %d"}` + c := `{"ObjectType":"iam.LdapBaseProperties","BindMethod":"BindMethod %d","EnableEncryption":true,"BaseDn":"BaseDn %d","EnableGroupAuthorization":true,"Domain":"Domain %d","ClassId":"iam.LdapBaseProperties","IsPasswordSet":true,"Attribute":"Attribute %d","Filter":"Filter %d","NestedGroupSearchDepth":32,"GroupAttribute":"GroupAttribute %d","BindDn":"BindDn %d","Timeout":32}` //test when the response is empty ffOpEmpty := flattenMapIamLdapBaseProperties(p, d) @@ -11707,14 +11707,14 @@ func TestFlattenMapIamLdapBaseProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLdapBaseProperties(p, d)[0] - expectedOp := map[string]interface{}{"bind_dn": "BindDn 1", "base_dn": "BaseDn 1", "class_id": "iam.LdapBaseProperties", "attribute": "Attribute 1", "nested_group_search_depth": 32, "enable_encryption": true, "enable_group_authorization": true, "timeout": 32, "object_type": "iam.LdapBaseProperties", "filter": "Filter 1", "group_attribute": "GroupAttribute 1", "domain": "Domain 1", "is_password_set": true, "bind_method": "BindMethod 1"} + expectedOp := map[string]interface{}{"object_type": "iam.LdapBaseProperties", "bind_method": "BindMethod 1", "enable_encryption": true, "base_dn": "BaseDn 1", "enable_group_authorization": true, "domain": "Domain 1", "class_id": "iam.LdapBaseProperties", "is_password_set": true, "attribute": "Attribute 1", "filter": "Filter 1", "nested_group_search_depth": 32, "group_attribute": "GroupAttribute 1", "bind_dn": "BindDn 1", "timeout": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamLdapDnsParameters(t *testing.T) { p := models.IamLdapDnsParameters{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.LdapDnsParameters","ObjectType":"iam.LdapDnsParameters","Source":"Source %d","SearchDomain":"SearchDomain %d","SearchForest":"SearchForest %d"}` + c := `{"Source":"Source %d","ClassId":"iam.LdapDnsParameters","ObjectType":"iam.LdapDnsParameters","SearchDomain":"SearchDomain %d","SearchForest":"SearchForest %d"}` //test when the response is empty ffOpEmpty := flattenMapIamLdapDnsParameters(p, d) @@ -11725,14 +11725,14 @@ func TestFlattenMapIamLdapDnsParameters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLdapDnsParameters(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "iam.LdapDnsParameters", "object_type": "iam.LdapDnsParameters", "nr_source": "Source 1", "search_domain": "SearchDomain 1", "search_forest": "SearchForest 1"} + expectedOp := map[string]interface{}{"nr_source": "Source 1", "class_id": "iam.LdapDnsParameters", "object_type": "iam.LdapDnsParameters", "search_domain": "SearchDomain 1", "search_forest": "SearchForest 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamLdapPolicyRelationship(t *testing.T) { p := models.IamLdapPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamLdapPolicyRelationship(p, d) @@ -11743,7 +11743,7 @@ func TestFlattenMapIamLdapPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLdapPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11768,7 +11768,7 @@ func TestFlattenMapIamLocalUserPasswordRelationship(t *testing.T) { func TestFlattenMapIamPermissionRelationship(t *testing.T) { p := models.IamPermissionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapIamPermissionRelationship(p, d) @@ -11779,14 +11779,14 @@ func TestFlattenMapIamPermissionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamPermissionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamPrivateKeySpecRelationship(t *testing.T) { p := models.IamPrivateKeySpecRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamPrivateKeySpecRelationship(p, d) @@ -11797,14 +11797,14 @@ func TestFlattenMapIamPrivateKeySpecRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamPrivateKeySpecRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamQualifierRelationship(t *testing.T) { p := models.IamQualifierRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamQualifierRelationship(p, d) @@ -11815,14 +11815,14 @@ func TestFlattenMapIamQualifierRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamQualifierRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamResourceLimitsRelationship(t *testing.T) { p := models.IamResourceLimitsRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamResourceLimitsRelationship(p, d) @@ -11833,7 +11833,7 @@ func TestFlattenMapIamResourceLimitsRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamResourceLimitsRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11858,7 +11858,7 @@ func TestFlattenMapIamSecurityHolderRelationship(t *testing.T) { func TestFlattenMapIamServiceProviderRelationship(t *testing.T) { p := models.IamServiceProviderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamServiceProviderRelationship(p, d) @@ -11869,7 +11869,7 @@ func TestFlattenMapIamServiceProviderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamServiceProviderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11894,7 +11894,7 @@ func TestFlattenMapIamSessionRelationship(t *testing.T) { func TestFlattenMapIamSessionLimitsRelationship(t *testing.T) { p := models.IamSessionLimitsRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamSessionLimitsRelationship(p, d) @@ -11905,7 +11905,7 @@ func TestFlattenMapIamSessionLimitsRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamSessionLimitsRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11966,7 +11966,7 @@ func TestFlattenMapIamUserGroupRelationship(t *testing.T) { func TestFlattenMapInfraHardwareInfo(t *testing.T) { p := models.InfraHardwareInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"infra.HardwareInfo","CpuCores":32,"CpuSpeed":32,"MemorySize":32,"ClassId":"infra.HardwareInfo"}` + c := `{"CpuCores":32,"CpuSpeed":32,"MemorySize":32,"ClassId":"infra.HardwareInfo","ObjectType":"infra.HardwareInfo"}` //test when the response is empty ffOpEmpty := flattenMapInfraHardwareInfo(p, d) @@ -11977,14 +11977,14 @@ func TestFlattenMapInfraHardwareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInfraHardwareInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "infra.HardwareInfo", "cpu_cores": 32, "cpu_speed": 32, "memory_size": 32, "class_id": "infra.HardwareInfo"} + expectedOp := map[string]interface{}{"cpu_cores": 32, "cpu_speed": 32, "memory_size": 32, "class_id": "infra.HardwareInfo", "object_type": "infra.HardwareInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapInventoryBaseRelationship(t *testing.T) { p := models.InventoryBaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapInventoryBaseRelationship(p, d) @@ -11995,14 +11995,14 @@ func TestFlattenMapInventoryBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInventoryBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapInventoryDeviceInfoRelationship(t *testing.T) { p := models.InventoryDeviceInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapInventoryDeviceInfoRelationship(p, d) @@ -12013,14 +12013,14 @@ func TestFlattenMapInventoryDeviceInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInventoryDeviceInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapInventoryGenericInventoryHolderRelationship(t *testing.T) { p := models.InventoryGenericInventoryHolderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapInventoryGenericInventoryHolderRelationship(p, d) @@ -12031,14 +12031,14 @@ func TestFlattenMapInventoryGenericInventoryHolderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInventoryGenericInventoryHolderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolBlockLeaseRelationship(t *testing.T) { p := models.IppoolBlockLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolBlockLeaseRelationship(p, d) @@ -12049,14 +12049,14 @@ func TestFlattenMapIppoolBlockLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolBlockLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpLeaseRelationship(t *testing.T) { p := models.IppoolIpLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpLeaseRelationship(p, d) @@ -12067,14 +12067,14 @@ func TestFlattenMapIppoolIpLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV4Block(t *testing.T) { p := models.IppoolIpV4Block{} var d = &schema.ResourceData{} - c := `{"To":"To %d","From":"From %d","ClassId":"ippool.IpV4Block","ObjectType":"ippool.IpV4Block","Size":32}` + c := `{"ObjectType":"ippool.IpV4Block","Size":32,"From":"From %d","To":"To %d","ClassId":"ippool.IpV4Block"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV4Block(p, d) @@ -12085,14 +12085,14 @@ func TestFlattenMapIppoolIpV4Block(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV4Block(p, d)[0] - expectedOp := map[string]interface{}{"to": "To 1", "from": "From 1", "class_id": "ippool.IpV4Block", "object_type": "ippool.IpV4Block", "size": 32} + expectedOp := map[string]interface{}{"object_type": "ippool.IpV4Block", "size": 32, "from": "From 1", "to": "To 1", "class_id": "ippool.IpV4Block"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV4Config(t *testing.T) { p := models.IppoolIpV4Config{} var d = &schema.ResourceData{} - c := `{"Netmask":"Netmask %d","PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","Gateway":"Gateway %d","ClassId":"ippool.IpV4Config","ObjectType":"ippool.IpV4Config"}` + c := `{"Gateway":"Gateway %d","Netmask":"Netmask %d","PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","ClassId":"ippool.IpV4Config","ObjectType":"ippool.IpV4Config"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV4Config(p, d) @@ -12103,14 +12103,14 @@ func TestFlattenMapIppoolIpV4Config(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV4Config(p, d)[0] - expectedOp := map[string]interface{}{"netmask": "Netmask 1", "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "gateway": "Gateway 1", "class_id": "ippool.IpV4Config", "object_type": "ippool.IpV4Config"} + expectedOp := map[string]interface{}{"gateway": "Gateway 1", "netmask": "Netmask 1", "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "class_id": "ippool.IpV4Config", "object_type": "ippool.IpV4Config"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV6Block(t *testing.T) { p := models.IppoolIpV6Block{} var d = &schema.ResourceData{} - c := `{"Size":32,"ClassId":"ippool.IpV6Block","To":"To %d","From":"From %d","ObjectType":"ippool.IpV6Block"}` + c := `{"To":"To %d","From":"From %d","ObjectType":"ippool.IpV6Block","Size":32,"ClassId":"ippool.IpV6Block"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV6Block(p, d) @@ -12121,14 +12121,14 @@ func TestFlattenMapIppoolIpV6Block(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV6Block(p, d)[0] - expectedOp := map[string]interface{}{"size": 32, "class_id": "ippool.IpV6Block", "to": "To 1", "from": "From 1", "object_type": "ippool.IpV6Block"} + expectedOp := map[string]interface{}{"to": "To 1", "from": "From 1", "object_type": "ippool.IpV6Block", "size": 32, "class_id": "ippool.IpV6Block"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV6Config(t *testing.T) { p := models.IppoolIpV6Config{} var d = &schema.ResourceData{} - c := `{"PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","Gateway":"Gateway %d","Prefix":32,"ClassId":"ippool.IpV6Config","ObjectType":"ippool.IpV6Config"}` + c := `{"ClassId":"ippool.IpV6Config","Gateway":"Gateway %d","Prefix":32,"PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","ObjectType":"ippool.IpV6Config"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV6Config(p, d) @@ -12139,14 +12139,14 @@ func TestFlattenMapIppoolIpV6Config(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV6Config(p, d)[0] - expectedOp := map[string]interface{}{"primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "gateway": "Gateway 1", "prefix": 32, "class_id": "ippool.IpV6Config", "object_type": "ippool.IpV6Config"} + expectedOp := map[string]interface{}{"class_id": "ippool.IpV6Config", "gateway": "Gateway 1", "prefix": 32, "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "object_type": "ippool.IpV6Config"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolPoolRelationship(t *testing.T) { p := models.IppoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapIppoolPoolRelationship(p, d) @@ -12157,14 +12157,14 @@ func TestFlattenMapIppoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolPoolMemberRelationship(t *testing.T) { p := models.IppoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolPoolMemberRelationship(p, d) @@ -12175,14 +12175,14 @@ func TestFlattenMapIppoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolShadowBlockRelationship(t *testing.T) { p := models.IppoolShadowBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolShadowBlockRelationship(p, d) @@ -12193,14 +12193,14 @@ func TestFlattenMapIppoolShadowBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolShadowBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolShadowPoolRelationship(t *testing.T) { p := models.IppoolShadowPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolShadowPoolRelationship(p, d) @@ -12211,14 +12211,14 @@ func TestFlattenMapIppoolShadowPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolShadowPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolUniverseRelationship(t *testing.T) { p := models.IppoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolUniverseRelationship(p, d) @@ -12229,14 +12229,14 @@ func TestFlattenMapIppoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolBlockRelationship(t *testing.T) { p := models.IqnpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolBlockRelationship(p, d) @@ -12247,14 +12247,14 @@ func TestFlattenMapIqnpoolBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolIqnSuffixBlock(t *testing.T) { p := models.IqnpoolIqnSuffixBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"iqnpool.IqnSuffixBlock","ObjectType":"iqnpool.IqnSuffixBlock","Size":32,"From":32,"Suffix":"Suffix %d","To":32}` + c := `{"ClassId":"iqnpool.IqnSuffixBlock","To":32,"From":32,"Suffix":"Suffix %d","ObjectType":"iqnpool.IqnSuffixBlock","Size":32}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolIqnSuffixBlock(p, d) @@ -12265,14 +12265,14 @@ func TestFlattenMapIqnpoolIqnSuffixBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolIqnSuffixBlock(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "iqnpool.IqnSuffixBlock", "object_type": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 1", "to": 32} + expectedOp := map[string]interface{}{"class_id": "iqnpool.IqnSuffixBlock", "to": 32, "from": 32, "suffix": "Suffix 1", "object_type": "iqnpool.IqnSuffixBlock", "size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolLeaseRelationship(t *testing.T) { p := models.IqnpoolLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolLeaseRelationship(p, d) @@ -12283,14 +12283,14 @@ func TestFlattenMapIqnpoolLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolPoolRelationship(t *testing.T) { p := models.IqnpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolPoolRelationship(p, d) @@ -12301,14 +12301,14 @@ func TestFlattenMapIqnpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolPoolMemberRelationship(t *testing.T) { p := models.IqnpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolPoolMemberRelationship(p, d) @@ -12319,14 +12319,14 @@ func TestFlattenMapIqnpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolUniverseRelationship(t *testing.T) { p := models.IqnpoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolUniverseRelationship(p, d) @@ -12337,14 +12337,14 @@ func TestFlattenMapIqnpoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAciCniProfileRelationship(t *testing.T) { p := models.KubernetesAciCniProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAciCniProfileRelationship(p, d) @@ -12355,14 +12355,14 @@ func TestFlattenMapKubernetesAciCniProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAciCniProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesActionInfo(t *testing.T) { p := models.KubernetesActionInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.ActionInfo","Status":"Status %d","FailureReason":"FailureReason %d","Name":"Name %d","ClassId":"kubernetes.ActionInfo"}` + c := `{"Status":"Status %d","FailureReason":"FailureReason %d","Name":"Name %d","ObjectType":"kubernetes.ActionInfo","ClassId":"kubernetes.ActionInfo"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesActionInfo(p, d) @@ -12373,14 +12373,14 @@ func TestFlattenMapKubernetesActionInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesActionInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.ActionInfo", "status": "Status 1", "failure_reason": "FailureReason 1", "name": "Name 1", "class_id": "kubernetes.ActionInfo"} + expectedOp := map[string]interface{}{"status": "Status 1", "failure_reason": "FailureReason 1", "name": "Name 1", "object_type": "kubernetes.ActionInfo", "class_id": "kubernetes.ActionInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAddonConfiguration(t *testing.T) { p := models.KubernetesAddonConfiguration{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.AddonConfiguration","InstallStrategy":"InstallStrategy %d","Overrides":"Overrides %d","ReleaseNamespace":"ReleaseNamespace %d","UpgradeStrategy":"UpgradeStrategy %d","ClassId":"kubernetes.AddonConfiguration","ReleaseName":"ReleaseName %d"}` + c := `{"Overrides":"Overrides %d","UpgradeStrategy":"UpgradeStrategy %d","ClassId":"kubernetes.AddonConfiguration","ObjectType":"kubernetes.AddonConfiguration","InstallStrategy":"InstallStrategy %d","ReleaseName":"ReleaseName %d","ReleaseNamespace":"ReleaseNamespace %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAddonConfiguration(p, d) @@ -12391,14 +12391,14 @@ func TestFlattenMapKubernetesAddonConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAddonConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.AddonConfiguration", "install_strategy": "InstallStrategy 1", "overrides": "Overrides 1", "release_namespace": "ReleaseNamespace 1", "upgrade_strategy": "UpgradeStrategy 1", "class_id": "kubernetes.AddonConfiguration", "release_name": "ReleaseName 1"} + expectedOp := map[string]interface{}{"overrides": "Overrides 1", "upgrade_strategy": "UpgradeStrategy 1", "class_id": "kubernetes.AddonConfiguration", "object_type": "kubernetes.AddonConfiguration", "install_strategy": "InstallStrategy 1", "release_name": "ReleaseName 1", "release_namespace": "ReleaseNamespace 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAddonDefinitionRelationship(t *testing.T) { p := models.KubernetesAddonDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAddonDefinitionRelationship(p, d) @@ -12409,7 +12409,7 @@ func TestFlattenMapKubernetesAddonDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAddonDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12452,7 +12452,7 @@ func TestFlattenMapKubernetesBaseVirtualMachineInfraConfig(t *testing.T) { func TestFlattenMapKubernetesCatalogRelationship(t *testing.T) { p := models.KubernetesCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesCatalogRelationship(p, d) @@ -12463,14 +12463,14 @@ func TestFlattenMapKubernetesCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterRelationship(t *testing.T) { p := models.KubernetesClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterRelationship(p, d) @@ -12481,14 +12481,14 @@ func TestFlattenMapKubernetesClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterAddonProfileRelationship(t *testing.T) { p := models.KubernetesClusterAddonProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterAddonProfileRelationship(p, d) @@ -12499,14 +12499,14 @@ func TestFlattenMapKubernetesClusterAddonProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterAddonProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterCertificateConfiguration(t *testing.T) { p := models.KubernetesClusterCertificateConfiguration{} var d = &schema.ResourceData{} - c := `{"SaPublicKey":"SaPublicKey %d","ObjectType":"kubernetes.ClusterCertificateConfiguration","CaCert":"CaCert %d","FrontProxyCert":"FrontProxyCert %d","EtcdCert":"EtcdCert %d","ClassId":"kubernetes.ClusterCertificateConfiguration"}` + c := `{"ClassId":"kubernetes.ClusterCertificateConfiguration","SaPublicKey":"SaPublicKey %d","FrontProxyCert":"FrontProxyCert %d","ObjectType":"kubernetes.ClusterCertificateConfiguration","EtcdCert":"EtcdCert %d","CaCert":"CaCert %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterCertificateConfiguration(p, d) @@ -12517,14 +12517,14 @@ func TestFlattenMapKubernetesClusterCertificateConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterCertificateConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"sa_public_key": "SaPublicKey 1", "object_type": "kubernetes.ClusterCertificateConfiguration", "ca_cert": "CaCert 1", "front_proxy_cert": "FrontProxyCert 1", "etcd_cert": "EtcdCert 1", "class_id": "kubernetes.ClusterCertificateConfiguration"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.ClusterCertificateConfiguration", "sa_public_key": "SaPublicKey 1", "front_proxy_cert": "FrontProxyCert 1", "object_type": "kubernetes.ClusterCertificateConfiguration", "etcd_cert": "EtcdCert 1", "ca_cert": "CaCert 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterManagementConfig(t *testing.T) { p := models.KubernetesClusterManagementConfig{} var d = &schema.ResourceData{} - c := `{"LoadBalancerCount":32,"MasterVip":"MasterVip %d","ClassId":"kubernetes.ClusterManagementConfig","ObjectType":"kubernetes.ClusterManagementConfig","SshUser":"SshUser %d"}` + c := `{"SshUser":"SshUser %d","LoadBalancerCount":32,"MasterVip":"MasterVip %d","ClassId":"kubernetes.ClusterManagementConfig","ObjectType":"kubernetes.ClusterManagementConfig"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterManagementConfig(p, d) @@ -12535,14 +12535,14 @@ func TestFlattenMapKubernetesClusterManagementConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterManagementConfig(p, d)[0] - expectedOp := map[string]interface{}{"load_balancer_count": 32, "master_vip": "MasterVip 1", "class_id": "kubernetes.ClusterManagementConfig", "object_type": "kubernetes.ClusterManagementConfig", "ssh_user": "SshUser 1"} + expectedOp := map[string]interface{}{"ssh_user": "SshUser 1", "load_balancer_count": 32, "master_vip": "MasterVip 1", "class_id": "kubernetes.ClusterManagementConfig", "object_type": "kubernetes.ClusterManagementConfig"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterProfileRelationship(t *testing.T) { p := models.KubernetesClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterProfileRelationship(p, d) @@ -12553,7 +12553,7 @@ func TestFlattenMapKubernetesClusterProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12578,7 +12578,7 @@ func TestFlattenMapKubernetesCniConfig(t *testing.T) { func TestFlattenMapKubernetesConfigResultRelationship(t *testing.T) { p := models.KubernetesConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesConfigResultRelationship(p, d) @@ -12589,7 +12589,7 @@ func TestFlattenMapKubernetesConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12614,7 +12614,7 @@ func TestFlattenMapKubernetesConfiguration(t *testing.T) { func TestFlattenMapKubernetesContainerRuntimePolicyRelationship(t *testing.T) { p := models.KubernetesContainerRuntimePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesContainerRuntimePolicyRelationship(p, d) @@ -12625,14 +12625,14 @@ func TestFlattenMapKubernetesContainerRuntimePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesContainerRuntimePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesDaemonSetStatus(t *testing.T) { p := models.KubernetesDaemonSetStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.DaemonSetStatus","NumberAvailable":"NumberAvailable %d","ObservedGeneration":32,"NumberMisscheduled":32,"UpdatedNumberScheduled":"UpdatedNumberScheduled %d","NumberReady":32,"ClassId":"kubernetes.DaemonSetStatus","DesiredNumberScheduled":32,"CurrentNumberScheduled":32}` + c := `{"NumberAvailable":"NumberAvailable %d","UpdatedNumberScheduled":"UpdatedNumberScheduled %d","CurrentNumberScheduled":32,"ClassId":"kubernetes.DaemonSetStatus","ObjectType":"kubernetes.DaemonSetStatus","ObservedGeneration":32,"DesiredNumberScheduled":32,"NumberReady":32,"NumberMisscheduled":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesDaemonSetStatus(p, d) @@ -12643,14 +12643,14 @@ func TestFlattenMapKubernetesDaemonSetStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesDaemonSetStatus(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.DaemonSetStatus", "number_available": "NumberAvailable 1", "observed_generation": 32, "number_misscheduled": 32, "updated_number_scheduled": "UpdatedNumberScheduled 1", "number_ready": 32, "class_id": "kubernetes.DaemonSetStatus", "desired_number_scheduled": 32, "current_number_scheduled": 32} + expectedOp := map[string]interface{}{"number_available": "NumberAvailable 1", "updated_number_scheduled": "UpdatedNumberScheduled 1", "current_number_scheduled": 32, "class_id": "kubernetes.DaemonSetStatus", "object_type": "kubernetes.DaemonSetStatus", "observed_generation": 32, "desired_number_scheduled": 32, "number_ready": 32, "number_misscheduled": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesDeploymentStatus(t *testing.T) { p := models.KubernetesDeploymentStatus{} var d = &schema.ResourceData{} - c := `{"ObservedGeneration":32,"ReadyReplicas":32,"Replicas":32,"UpdatedReplicas":32,"ClassId":"kubernetes.DeploymentStatus","ObjectType":"kubernetes.DeploymentStatus","AvailableReplicas":32}` + c := `{"ReadyReplicas":32,"Replicas":32,"UpdatedReplicas":32,"ClassId":"kubernetes.DeploymentStatus","ObjectType":"kubernetes.DeploymentStatus","AvailableReplicas":32,"ObservedGeneration":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesDeploymentStatus(p, d) @@ -12661,14 +12661,14 @@ func TestFlattenMapKubernetesDeploymentStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesDeploymentStatus(p, d)[0] - expectedOp := map[string]interface{}{"observed_generation": 32, "ready_replicas": 32, "replicas": 32, "updated_replicas": 32, "class_id": "kubernetes.DeploymentStatus", "object_type": "kubernetes.DeploymentStatus", "available_replicas": 32} + expectedOp := map[string]interface{}{"ready_replicas": 32, "replicas": 32, "updated_replicas": 32, "class_id": "kubernetes.DeploymentStatus", "object_type": "kubernetes.DeploymentStatus", "available_replicas": 32, "observed_generation": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesIngressStatus(t *testing.T) { p := models.KubernetesIngressStatus{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.IngressStatus","ObjectType":"kubernetes.IngressStatus"}` + c := `{"ObjectType":"kubernetes.IngressStatus","ClassId":"kubernetes.IngressStatus"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesIngressStatus(p, d) @@ -12679,14 +12679,14 @@ func TestFlattenMapKubernetesIngressStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesIngressStatus(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "kubernetes.IngressStatus", "object_type": "kubernetes.IngressStatus"} + expectedOp := map[string]interface{}{"object_type": "kubernetes.IngressStatus", "class_id": "kubernetes.IngressStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNetworkPolicyRelationship(t *testing.T) { p := models.KubernetesNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNetworkPolicyRelationship(p, d) @@ -12697,7 +12697,7 @@ func TestFlattenMapKubernetesNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12722,7 +12722,7 @@ func TestFlattenMapKubernetesNodeGroupProfileRelationship(t *testing.T) { func TestFlattenMapKubernetesNodeInfo(t *testing.T) { p := models.KubernetesNodeInfo{} var d = &schema.ResourceData{} - c := `{"KubeletVersion":"KubeletVersion %d","KernelVersion":"KernelVersion %d","BootId":"BootId %d","ContainerRuntimeVersion":"ContainerRuntimeVersion %d","ClassId":"kubernetes.NodeInfo","ObjectType":"kubernetes.NodeInfo","KubeProxyVersion":"KubeProxyVersion %d","MachineId":"MachineId %d","OperatingSystem":"OperatingSystem %d","OsImage":"OsImage %d","SystemUuid":"SystemUuid %d","Architecture":"Architecture %d"}` + c := `{"Architecture":"Architecture %d","MachineId":"MachineId %d","SystemUuid":"SystemUuid %d","BootId":"BootId %d","KernelVersion":"KernelVersion %d","ContainerRuntimeVersion":"ContainerRuntimeVersion %d","KubeProxyVersion":"KubeProxyVersion %d","KubeletVersion":"KubeletVersion %d","ObjectType":"kubernetes.NodeInfo","ClassId":"kubernetes.NodeInfo","OperatingSystem":"OperatingSystem %d","OsImage":"OsImage %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeInfo(p, d) @@ -12733,7 +12733,7 @@ func TestFlattenMapKubernetesNodeInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeInfo(p, d)[0] - expectedOp := map[string]interface{}{"kubelet_version": "KubeletVersion 1", "kernel_version": "KernelVersion 1", "boot_id": "BootId 1", "container_runtime_version": "ContainerRuntimeVersion 1", "class_id": "kubernetes.NodeInfo", "object_type": "kubernetes.NodeInfo", "kube_proxy_version": "KubeProxyVersion 1", "machine_id": "MachineId 1", "operating_system": "OperatingSystem 1", "os_image": "OsImage 1", "system_uuid": "SystemUuid 1", "architecture": "Architecture 1"} + expectedOp := map[string]interface{}{"architecture": "Architecture 1", "machine_id": "MachineId 1", "system_uuid": "SystemUuid 1", "boot_id": "BootId 1", "kernel_version": "KernelVersion 1", "container_runtime_version": "ContainerRuntimeVersion 1", "kube_proxy_version": "KubeProxyVersion 1", "kubelet_version": "KubeletVersion 1", "object_type": "kubernetes.NodeInfo", "class_id": "kubernetes.NodeInfo", "operating_system": "OperatingSystem 1", "os_image": "OsImage 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12758,7 +12758,7 @@ func TestFlattenMapKubernetesNodeProfileRelationship(t *testing.T) { func TestFlattenMapKubernetesNodeSpec(t *testing.T) { p := models.KubernetesNodeSpec{} var d = &schema.ResourceData{} - c := `{"PodCidr":"PodCidr %d","ProviderId":"ProviderId %d","ClassId":"kubernetes.NodeSpec","ObjectType":"kubernetes.NodeSpec"}` + c := `{"ClassId":"kubernetes.NodeSpec","ObjectType":"kubernetes.NodeSpec","PodCidr":"PodCidr %d","ProviderId":"ProviderId %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeSpec(p, d) @@ -12769,7 +12769,7 @@ func TestFlattenMapKubernetesNodeSpec(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeSpec(p, d)[0] - expectedOp := map[string]interface{}{"pod_cidr": "PodCidr 1", "provider_id": "ProviderId 1", "class_id": "kubernetes.NodeSpec", "object_type": "kubernetes.NodeSpec"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.NodeSpec", "object_type": "kubernetes.NodeSpec", "pod_cidr": "PodCidr 1", "provider_id": "ProviderId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12794,7 +12794,7 @@ func TestFlattenMapKubernetesObjectMeta(t *testing.T) { func TestFlattenMapKubernetesPodStatus(t *testing.T) { p := models.KubernetesPodStatus{} var d = &schema.ResourceData{} - c := `{"QosClass":"QosClass %d","StartTime":"StartTime %d","HostIp":"HostIp %d","Phase":"Phase %d","ClassId":"kubernetes.PodStatus","ObjectType":"kubernetes.PodStatus","PodIp":"PodIp %d"}` + c := `{"ObjectType":"kubernetes.PodStatus","QosClass":"QosClass %d","StartTime":"StartTime %d","HostIp":"HostIp %d","Phase":"Phase %d","PodIp":"PodIp %d","ClassId":"kubernetes.PodStatus"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesPodStatus(p, d) @@ -12805,14 +12805,14 @@ func TestFlattenMapKubernetesPodStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesPodStatus(p, d)[0] - expectedOp := map[string]interface{}{"qos_class": "QosClass 1", "start_time": "StartTime 1", "host_ip": "HostIp 1", "phase": "Phase 1", "class_id": "kubernetes.PodStatus", "object_type": "kubernetes.PodStatus", "pod_ip": "PodIp 1"} + expectedOp := map[string]interface{}{"object_type": "kubernetes.PodStatus", "qos_class": "QosClass 1", "start_time": "StartTime 1", "host_ip": "HostIp 1", "phase": "Phase 1", "pod_ip": "PodIp 1", "class_id": "kubernetes.PodStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesProxyConfig(t *testing.T) { p := models.KubernetesProxyConfig{} var d = &schema.ResourceData{} - c := `{"Port":32,"Username":"Username %d","ObjectType":"kubernetes.ProxyConfig","Hostname":"Hostname %d","IsPasswordSet":true,"ClassId":"kubernetes.ProxyConfig","Protocol":"Protocol %d"}` + c := `{"Protocol":"Protocol %d","ClassId":"kubernetes.ProxyConfig","ObjectType":"kubernetes.ProxyConfig","Hostname":"Hostname %d","Port":32,"Username":"Username %d","IsPasswordSet":true}` //test when the response is empty ffOpEmpty := flattenMapKubernetesProxyConfig(p, d) @@ -12823,7 +12823,7 @@ func TestFlattenMapKubernetesProxyConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesProxyConfig(p, d)[0] - expectedOp := map[string]interface{}{"port": 32, "username": "Username 1", "object_type": "kubernetes.ProxyConfig", "hostname": "Hostname 1", "is_password_set": true, "class_id": "kubernetes.ProxyConfig", "protocol": "Protocol 1"} + expectedOp := map[string]interface{}{"protocol": "Protocol 1", "class_id": "kubernetes.ProxyConfig", "object_type": "kubernetes.ProxyConfig", "hostname": "Hostname 1", "port": 32, "username": "Username 1", "is_password_set": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12848,7 +12848,7 @@ func TestFlattenMapKubernetesServiceStatus(t *testing.T) { func TestFlattenMapKubernetesStatefulSetStatus(t *testing.T) { p := models.KubernetesStatefulSetStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.StatefulSetStatus","AvailableReplicas":32,"CollisionCount":32,"ReadyReplicas":32,"CurrentRevision":"CurrentRevision %d","ObservedGeneration":32,"ClassId":"kubernetes.StatefulSetStatus","UpdatedReplicas":32,"Replicas":32,"UpdateRevision":"UpdateRevision %d"}` + c := `{"UpdateRevision":"UpdateRevision %d","ClassId":"kubernetes.StatefulSetStatus","ObjectType":"kubernetes.StatefulSetStatus","CurrentRevision":"CurrentRevision %d","UpdatedReplicas":32,"ObservedGeneration":32,"CollisionCount":32,"ReadyReplicas":32,"Replicas":32,"AvailableReplicas":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesStatefulSetStatus(p, d) @@ -12859,7 +12859,7 @@ func TestFlattenMapKubernetesStatefulSetStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesStatefulSetStatus(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.StatefulSetStatus", "available_replicas": 32, "collision_count": 32, "ready_replicas": 32, "current_revision": "CurrentRevision 1", "observed_generation": 32, "class_id": "kubernetes.StatefulSetStatus", "updated_replicas": 32, "replicas": 32, "update_revision": "UpdateRevision 1"} + expectedOp := map[string]interface{}{"update_revision": "UpdateRevision 1", "class_id": "kubernetes.StatefulSetStatus", "object_type": "kubernetes.StatefulSetStatus", "current_revision": "CurrentRevision 1", "updated_replicas": 32, "observed_generation": 32, "collision_count": 32, "ready_replicas": 32, "replicas": 32, "available_replicas": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12884,7 +12884,7 @@ func TestFlattenMapKubernetesSysConfigPolicyRelationship(t *testing.T) { func TestFlattenMapKubernetesTrustedRegistriesPolicyRelationship(t *testing.T) { p := models.KubernetesTrustedRegistriesPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesTrustedRegistriesPolicyRelationship(p, d) @@ -12895,14 +12895,14 @@ func TestFlattenMapKubernetesTrustedRegistriesPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesTrustedRegistriesPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVersionRelationship(t *testing.T) { p := models.KubernetesVersionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVersionRelationship(p, d) @@ -12913,14 +12913,14 @@ func TestFlattenMapKubernetesVersionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVersionPolicyRelationship(t *testing.T) { p := models.KubernetesVersionPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVersionPolicyRelationship(p, d) @@ -12931,7 +12931,7 @@ func TestFlattenMapKubernetesVersionPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVersionPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12956,7 +12956,7 @@ func TestFlattenMapKubernetesVirtualMachineInfraConfigPolicyRelationship(t *test func TestFlattenMapKubernetesVirtualMachineInstanceTypeRelationship(t *testing.T) { p := models.KubernetesVirtualMachineInstanceTypeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVirtualMachineInstanceTypeRelationship(p, d) @@ -12967,14 +12967,14 @@ func TestFlattenMapKubernetesVirtualMachineInstanceTypeRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVirtualMachineInstanceTypeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKvmSessionRelationship(t *testing.T) { p := models.KvmSessionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKvmSessionRelationship(p, d) @@ -12985,14 +12985,14 @@ func TestFlattenMapKvmSessionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKvmSessionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKvmTunnelRelationship(t *testing.T) { p := models.KvmTunnelRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKvmTunnelRelationship(p, d) @@ -13003,14 +13003,14 @@ func TestFlattenMapKvmTunnelRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKvmTunnelRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseAccountLicenseDataRelationship(t *testing.T) { p := models.LicenseAccountLicenseDataRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapLicenseAccountLicenseDataRelationship(p, d) @@ -13021,14 +13021,14 @@ func TestFlattenMapLicenseAccountLicenseDataRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseAccountLicenseDataRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseCustomerOpRelationship(t *testing.T) { p := models.LicenseCustomerOpRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapLicenseCustomerOpRelationship(p, d) @@ -13039,14 +13039,14 @@ func TestFlattenMapLicenseCustomerOpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseCustomerOpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIwoCustomerOpRelationship(t *testing.T) { p := models.LicenseIwoCustomerOpRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIwoCustomerOpRelationship(p, d) @@ -13057,14 +13057,14 @@ func TestFlattenMapLicenseIwoCustomerOpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIwoCustomerOpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIwoLicenseCountRelationship(t *testing.T) { p := models.LicenseIwoLicenseCountRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIwoLicenseCountRelationship(p, d) @@ -13075,14 +13075,14 @@ func TestFlattenMapLicenseIwoLicenseCountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIwoLicenseCountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseSmartlicenseTokenRelationship(t *testing.T) { p := models.LicenseSmartlicenseTokenRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseSmartlicenseTokenRelationship(p, d) @@ -13093,14 +13093,14 @@ func TestFlattenMapLicenseSmartlicenseTokenRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseSmartlicenseTokenRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMacpoolBlock(t *testing.T) { p := models.MacpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"macpool.Block","ObjectType":"macpool.Block","Size":32,"From":"From %d","To":"To %d"}` + c := `{"ObjectType":"macpool.Block","Size":32,"To":"To %d","From":"From %d","ClassId":"macpool.Block"}` //test when the response is empty ffOpEmpty := flattenMapMacpoolBlock(p, d) @@ -13111,14 +13111,14 @@ func TestFlattenMapMacpoolBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMacpoolBlock(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "macpool.Block", "object_type": "macpool.Block", "size": 32, "from": "From 1", "to": "To 1"} + expectedOp := map[string]interface{}{"object_type": "macpool.Block", "size": 32, "to": "To 1", "from": "From 1", "class_id": "macpool.Block"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMacpoolIdBlockRelationship(t *testing.T) { p := models.MacpoolIdBlockRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapMacpoolIdBlockRelationship(p, d) @@ -13129,7 +13129,7 @@ func TestFlattenMapMacpoolIdBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMacpoolIdBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13154,7 +13154,7 @@ func TestFlattenMapMacpoolLeaseRelationship(t *testing.T) { func TestFlattenMapMacpoolPoolRelationship(t *testing.T) { p := models.MacpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapMacpoolPoolRelationship(p, d) @@ -13165,14 +13165,14 @@ func TestFlattenMapMacpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMacpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMacpoolPoolMemberRelationship(t *testing.T) { p := models.MacpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapMacpoolPoolMemberRelationship(p, d) @@ -13183,7 +13183,7 @@ func TestFlattenMapMacpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMacpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13208,7 +13208,7 @@ func TestFlattenMapMacpoolUniverseRelationship(t *testing.T) { func TestFlattenMapManagementControllerRelationship(t *testing.T) { p := models.ManagementControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapManagementControllerRelationship(p, d) @@ -13219,14 +13219,14 @@ func TestFlattenMapManagementControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapManagementControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapManagementEntityRelationship(t *testing.T) { p := models.ManagementEntityRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapManagementEntityRelationship(p, d) @@ -13237,14 +13237,14 @@ func TestFlattenMapManagementEntityRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapManagementEntityRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryArrayRelationship(t *testing.T) { p := models.MemoryArrayRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapMemoryArrayRelationship(p, d) @@ -13255,14 +13255,14 @@ func TestFlattenMapMemoryArrayRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryArrayRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryConfigResultRelationship(t *testing.T) { p := models.MemoryPersistentMemoryConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryConfigResultRelationship(p, d) @@ -13273,14 +13273,14 @@ func TestFlattenMapMemoryPersistentMemoryConfigResultRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryConfigurationRelationship(t *testing.T) { p := models.MemoryPersistentMemoryConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryConfigurationRelationship(p, d) @@ -13291,14 +13291,14 @@ func TestFlattenMapMemoryPersistentMemoryConfigurationRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryLocalSecurity(t *testing.T) { p := models.MemoryPersistentMemoryLocalSecurity{} var d = &schema.ResourceData{} - c := `{"ObjectType":"memory.PersistentMemoryLocalSecurity","ClassId":"memory.PersistentMemoryLocalSecurity","Enabled":true,"IsSecurePassphraseSet":true}` + c := `{"ClassId":"memory.PersistentMemoryLocalSecurity","ObjectType":"memory.PersistentMemoryLocalSecurity","Enabled":true,"IsSecurePassphraseSet":true}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryLocalSecurity(p, d) @@ -13309,14 +13309,14 @@ func TestFlattenMapMemoryPersistentMemoryLocalSecurity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryLocalSecurity(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "memory.PersistentMemoryLocalSecurity", "class_id": "memory.PersistentMemoryLocalSecurity", "enabled": true, "is_secure_passphrase_set": true} + expectedOp := map[string]interface{}{"class_id": "memory.PersistentMemoryLocalSecurity", "object_type": "memory.PersistentMemoryLocalSecurity", "enabled": true, "is_secure_passphrase_set": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryRegionRelationship(t *testing.T) { p := models.MemoryPersistentMemoryRegionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryRegionRelationship(p, d) @@ -13327,7 +13327,7 @@ func TestFlattenMapMemoryPersistentMemoryRegionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryRegionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13352,7 +13352,7 @@ func TestFlattenMapMoBaseMoRelationship(t *testing.T) { func TestFlattenMapMoVersionContext(t *testing.T) { p := models.MoVersionContext{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.VersionContext","Version":"Version %d","VersionType":"VersionType %d","ObjectType":"mo.VersionContext"}` + c := `{"ObjectType":"mo.VersionContext","VersionType":"VersionType %d","Version":"Version %d","ClassId":"mo.VersionContext"}` //test when the response is empty ffOpEmpty := flattenMapMoVersionContext(p, d) @@ -13363,14 +13363,14 @@ func TestFlattenMapMoVersionContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMoVersionContext(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.VersionContext", "nr_version": "Version 1", "version_type": "VersionType 1", "object_type": "mo.VersionContext"} + expectedOp := map[string]interface{}{"object_type": "mo.VersionContext", "version_type": "VersionType 1", "nr_version": "Version 1", "class_id": "mo.VersionContext"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNetworkElementRelationship(t *testing.T) { p := models.NetworkElementRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapNetworkElementRelationship(p, d) @@ -13381,14 +13381,14 @@ func TestFlattenMapNetworkElementRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNetworkElementRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNetworkFcZoneInfoRelationship(t *testing.T) { p := models.NetworkFcZoneInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapNetworkFcZoneInfoRelationship(p, d) @@ -13399,14 +13399,14 @@ func TestFlattenMapNetworkFcZoneInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNetworkFcZoneInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNetworkVlanPortInfoRelationship(t *testing.T) { p := models.NetworkVlanPortInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapNetworkVlanPortInfoRelationship(p, d) @@ -13417,14 +13417,14 @@ func TestFlattenMapNetworkVlanPortInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNetworkVlanPortInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiaapiNewReleaseDetail(t *testing.T) { p := models.NiaapiNewReleaseDetail{} var d = &schema.ResourceData{} - c := `{"Version":"Version %d","Description":"Description %d","SoftwareDownloadLink":"SoftwareDownloadLink %d","SoftwareDownloadLinkTitle":"SoftwareDownloadLinkTitle %d","ClassId":"niaapi.NewReleaseDetail","ReleaseNoteLinkTitle":"ReleaseNoteLinkTitle %d","ReleaseNoteLink":"ReleaseNoteLink %d","Title":"Title %d","Link":"Link %d","ObjectType":"niaapi.NewReleaseDetail"}` + c := `{"ReleaseNoteLink":"ReleaseNoteLink %d","SoftwareDownloadLink":"SoftwareDownloadLink %d","Title":"Title %d","ObjectType":"niaapi.NewReleaseDetail","Description":"Description %d","Version":"Version %d","SoftwareDownloadLinkTitle":"SoftwareDownloadLinkTitle %d","ClassId":"niaapi.NewReleaseDetail","Link":"Link %d","ReleaseNoteLinkTitle":"ReleaseNoteLinkTitle %d"}` //test when the response is empty ffOpEmpty := flattenMapNiaapiNewReleaseDetail(p, d) @@ -13435,14 +13435,14 @@ func TestFlattenMapNiaapiNewReleaseDetail(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiaapiNewReleaseDetail(p, d)[0] - expectedOp := map[string]interface{}{"nr_version": "Version 1", "description": "Description 1", "software_download_link": "SoftwareDownloadLink 1", "software_download_link_title": "SoftwareDownloadLinkTitle 1", "class_id": "niaapi.NewReleaseDetail", "release_note_link_title": "ReleaseNoteLinkTitle 1", "release_note_link": "ReleaseNoteLink 1", "title": "Title 1", "link": "Link 1", "object_type": "niaapi.NewReleaseDetail"} + expectedOp := map[string]interface{}{"release_note_link": "ReleaseNoteLink 1", "software_download_link": "SoftwareDownloadLink 1", "title": "Title 1", "object_type": "niaapi.NewReleaseDetail", "description": "Description 1", "nr_version": "Version 1", "software_download_link_title": "SoftwareDownloadLinkTitle 1", "class_id": "niaapi.NewReleaseDetail", "link": "Link 1", "release_note_link_title": "ReleaseNoteLinkTitle 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiaapiVersionRegexPlatform(t *testing.T) { p := models.NiaapiVersionRegexPlatform{} var d = &schema.ResourceData{} - c := `{"ClassId":"niaapi.VersionRegexPlatform","ObjectType":"niaapi.VersionRegexPlatform","Anyllregex":"Anyllregex %d"}` + c := `{"ObjectType":"niaapi.VersionRegexPlatform","ClassId":"niaapi.VersionRegexPlatform","Anyllregex":"Anyllregex %d"}` //test when the response is empty ffOpEmpty := flattenMapNiaapiVersionRegexPlatform(p, d) @@ -13453,14 +13453,14 @@ func TestFlattenMapNiaapiVersionRegexPlatform(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiaapiVersionRegexPlatform(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niaapi.VersionRegexPlatform", "object_type": "niaapi.VersionRegexPlatform", "anyllregex": "Anyllregex 1"} + expectedOp := map[string]interface{}{"object_type": "niaapi.VersionRegexPlatform", "class_id": "niaapi.VersionRegexPlatform", "anyllregex": "Anyllregex 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryBootflashDetails(t *testing.T) { p := models.NiatelemetryBootflashDetails{} var d = &schema.ResourceData{} - c := `{"ModelType":"ModelType %d","Serial":"Serial %d","ClassId":"niatelemetry.BootflashDetails","ObjectType":"niatelemetry.BootflashDetails","FwRev":"FwRev %d"}` + c := `{"ObjectType":"niatelemetry.BootflashDetails","Serial":"Serial %d","FwRev":"FwRev %d","ModelType":"ModelType %d","ClassId":"niatelemetry.BootflashDetails"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryBootflashDetails(p, d) @@ -13471,14 +13471,14 @@ func TestFlattenMapNiatelemetryBootflashDetails(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryBootflashDetails(p, d)[0] - expectedOp := map[string]interface{}{"model_type": "ModelType 1", "serial": "Serial 1", "class_id": "niatelemetry.BootflashDetails", "object_type": "niatelemetry.BootflashDetails", "fw_rev": "FwRev 1"} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.BootflashDetails", "serial": "Serial 1", "fw_rev": "FwRev 1", "model_type": "ModelType 1", "class_id": "niatelemetry.BootflashDetails"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryDiskinfo(t *testing.T) { p := models.NiatelemetryDiskinfo{} var d = &schema.ResourceData{} - c := `{"Used":32,"Free":32,"Name":"Name %d","Total":32,"ClassId":"niatelemetry.Diskinfo","ObjectType":"niatelemetry.Diskinfo"}` + c := `{"ObjectType":"niatelemetry.Diskinfo","Free":32,"Name":"Name %d","Total":32,"Used":32,"ClassId":"niatelemetry.Diskinfo"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryDiskinfo(p, d) @@ -13489,14 +13489,14 @@ func TestFlattenMapNiatelemetryDiskinfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryDiskinfo(p, d)[0] - expectedOp := map[string]interface{}{"used": 32, "free": 32, "name": "Name 1", "total": 32, "class_id": "niatelemetry.Diskinfo", "object_type": "niatelemetry.Diskinfo"} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.Diskinfo", "free": 32, "name": "Name 1", "total": 32, "used": 32, "class_id": "niatelemetry.Diskinfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryInterface(t *testing.T) { p := models.NiatelemetryInterface{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.Interface","ObjectType":"niatelemetry.Interface","InterfaceDownCount":32,"InterfaceUpCount":32}` + c := `{"InterfaceUpCount":32,"ObjectType":"niatelemetry.Interface","ClassId":"niatelemetry.Interface","InterfaceDownCount":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryInterface(p, d) @@ -13507,14 +13507,14 @@ func TestFlattenMapNiatelemetryInterface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryInterface(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niatelemetry.Interface", "object_type": "niatelemetry.Interface", "interface_down_count": 32, "interface_up_count": 32} + expectedOp := map[string]interface{}{"interface_up_count": 32, "object_type": "niatelemetry.Interface", "class_id": "niatelemetry.Interface", "interface_down_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNexusDashboardsRelationship(t *testing.T) { p := models.NiatelemetryNexusDashboardsRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNexusDashboardsRelationship(p, d) @@ -13525,14 +13525,14 @@ func TestFlattenMapNiatelemetryNexusDashboardsRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNexusDashboardsRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNiaInventoryRelationship(t *testing.T) { p := models.NiatelemetryNiaInventoryRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNiaInventoryRelationship(p, d) @@ -13543,14 +13543,14 @@ func TestFlattenMapNiatelemetryNiaInventoryRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNiaInventoryRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNiaLicenseStateRelationship(t *testing.T) { p := models.NiatelemetryNiaLicenseStateRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNiaLicenseStateRelationship(p, d) @@ -13561,14 +13561,14 @@ func TestFlattenMapNiatelemetryNiaLicenseStateRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNiaLicenseStateRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNvePacketCounters(t *testing.T) { p := models.NiatelemetryNvePacketCounters{} var d = &schema.ResourceData{} - c := `{"McastInpkts":32,"McastOutbytes":32,"UcastInpkts":32,"UcastOutpkts":32,"ClassId":"niatelemetry.NvePacketCounters","ObjectType":"niatelemetry.NvePacketCounters"}` + c := `{"ClassId":"niatelemetry.NvePacketCounters","McastInpkts":32,"McastOutbytes":32,"UcastInpkts":32,"UcastOutpkts":32,"ObjectType":"niatelemetry.NvePacketCounters"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNvePacketCounters(p, d) @@ -13579,14 +13579,14 @@ func TestFlattenMapNiatelemetryNvePacketCounters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNvePacketCounters(p, d)[0] - expectedOp := map[string]interface{}{"mcast_inpkts": 32, "mcast_outbytes": 32, "ucast_inpkts": 32, "ucast_outpkts": 32, "class_id": "niatelemetry.NvePacketCounters", "object_type": "niatelemetry.NvePacketCounters"} + expectedOp := map[string]interface{}{"class_id": "niatelemetry.NvePacketCounters", "mcast_inpkts": 32, "mcast_outbytes": 32, "ucast_inpkts": 32, "ucast_outpkts": 32, "object_type": "niatelemetry.NvePacketCounters"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNveVni(t *testing.T) { p := models.NiatelemetryNveVni{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.NveVni","ObjectType":"niatelemetry.NveVni","CpVniCount":32,"DpVniCount":32,"CpVniDown":32,"CpVniUp":32,"DpVniDown":32,"DpVniUp":32}` + c := `{"ObjectType":"niatelemetry.NveVni","CpVniCount":32,"CpVniDown":32,"CpVniUp":32,"DpVniCount":32,"DpVniDown":32,"ClassId":"niatelemetry.NveVni","DpVniUp":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNveVni(p, d) @@ -13597,14 +13597,14 @@ func TestFlattenMapNiatelemetryNveVni(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNveVni(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niatelemetry.NveVni", "object_type": "niatelemetry.NveVni", "cp_vni_count": 32, "dp_vni_count": 32, "cp_vni_down": 32, "cp_vni_up": 32, "dp_vni_down": 32, "dp_vni_up": 32} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.NveVni", "cp_vni_count": 32, "cp_vni_down": 32, "cp_vni_up": 32, "dp_vni_count": 32, "dp_vni_down": 32, "class_id": "niatelemetry.NveVni", "dp_vni_up": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNxosBgpMvpn(t *testing.T) { p := models.NiatelemetryNxosBgpMvpn{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niatelemetry.NxosBgpMvpn","TotalPaths":32,"NumberOfCommunities":32,"ClassId":"niatelemetry.NxosBgpMvpn","TotalNetworks":32,"MemoryUsed":32,"CapablePeers":32,"TableVersion":32,"ConfiguredPeers":32,"NumberOfClusterLists":32}` + c := `{"TableVersion":32,"NumberOfCommunities":32,"ConfiguredPeers":32,"TotalNetworks":32,"CapablePeers":32,"TotalPaths":32,"MemoryUsed":32,"NumberOfClusterLists":32,"ClassId":"niatelemetry.NxosBgpMvpn","ObjectType":"niatelemetry.NxosBgpMvpn"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNxosBgpMvpn(p, d) @@ -13615,14 +13615,14 @@ func TestFlattenMapNiatelemetryNxosBgpMvpn(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNxosBgpMvpn(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "niatelemetry.NxosBgpMvpn", "total_paths": 32, "number_of_communities": 32, "class_id": "niatelemetry.NxosBgpMvpn", "total_networks": 32, "memory_used": 32, "capable_peers": 32, "table_version": 32, "configured_peers": 32, "number_of_cluster_lists": 32} + expectedOp := map[string]interface{}{"table_version": 32, "number_of_communities": 32, "configured_peers": 32, "total_networks": 32, "capable_peers": 32, "total_paths": 32, "memory_used": 32, "number_of_cluster_lists": 32, "class_id": "niatelemetry.NxosBgpMvpn", "object_type": "niatelemetry.NxosBgpMvpn"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNxosVtp(t *testing.T) { p := models.NiatelemetryNxosVtp{} var d = &schema.ResourceData{} - c := `{"RunningVersion":"RunningVersion %d","TrapEnabled":"TrapEnabled %d","Version":32,"OperMode":"OperMode %d","PruningMode":"PruningMode %d","ClassId":"niatelemetry.NxosVtp","ObjectType":"niatelemetry.NxosVtp","V2Mode":"V2Mode %d"}` + c := `{"ObjectType":"niatelemetry.NxosVtp","Version":32,"OperMode":"OperMode %d","ClassId":"niatelemetry.NxosVtp","PruningMode":"PruningMode %d","RunningVersion":"RunningVersion %d","TrapEnabled":"TrapEnabled %d","V2Mode":"V2Mode %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNxosVtp(p, d) @@ -13633,14 +13633,14 @@ func TestFlattenMapNiatelemetryNxosVtp(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNxosVtp(p, d)[0] - expectedOp := map[string]interface{}{"running_version": "RunningVersion 1", "trap_enabled": "TrapEnabled 1", "nr_version": 32, "oper_mode": "OperMode 1", "pruning_mode": "PruningMode 1", "class_id": "niatelemetry.NxosVtp", "object_type": "niatelemetry.NxosVtp", "v2_mode": "V2Mode 1"} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.NxosVtp", "nr_version": 32, "oper_mode": "OperMode 1", "class_id": "niatelemetry.NxosVtp", "pruning_mode": "PruningMode 1", "running_version": "RunningVersion 1", "trap_enabled": "TrapEnabled 1", "v2_mode": "V2Mode 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetrySmartLicense(t *testing.T) { p := models.NiatelemetrySmartLicense{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niatelemetry.SmartLicense","SmartAccount":"SmartAccount %d","ActiveMode":"ActiveMode %d","AuthStatus":"AuthStatus %d","LicenseUdi":"LicenseUdi %d","ClassId":"niatelemetry.SmartLicense"}` + c := `{"LicenseUdi":"LicenseUdi %d","SmartAccount":"SmartAccount %d","ActiveMode":"ActiveMode %d","AuthStatus":"AuthStatus %d","ClassId":"niatelemetry.SmartLicense","ObjectType":"niatelemetry.SmartLicense"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetrySmartLicense(p, d) @@ -13651,14 +13651,14 @@ func TestFlattenMapNiatelemetrySmartLicense(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetrySmartLicense(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "niatelemetry.SmartLicense", "smart_account": "SmartAccount 1", "active_mode": "ActiveMode 1", "auth_status": "AuthStatus 1", "license_udi": "LicenseUdi 1", "class_id": "niatelemetry.SmartLicense"} + expectedOp := map[string]interface{}{"license_udi": "LicenseUdi 1", "smart_account": "SmartAccount 1", "active_mode": "ActiveMode 1", "auth_status": "AuthStatus 1", "class_id": "niatelemetry.SmartLicense", "object_type": "niatelemetry.SmartLicense"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOnpremSchedule(t *testing.T) { p := models.OnpremSchedule{} var d = &schema.ResourceData{} - c := `{"MonthOfYear":32,"DayOfWeek":32,"RepeatInterval":32,"WeekOfMonth":32,"ClassId":"onprem.Schedule","ObjectType":"onprem.Schedule","TimeOfDay":32,"TimeZone":"TimeZone %d","DayOfMonth":32}` + c := `{"WeekOfMonth":32,"RepeatInterval":32,"TimeOfDay":32,"ObjectType":"onprem.Schedule","DayOfMonth":32,"TimeZone":"TimeZone %d","DayOfWeek":32,"MonthOfYear":32,"ClassId":"onprem.Schedule"}` //test when the response is empty ffOpEmpty := flattenMapOnpremSchedule(p, d) @@ -13669,14 +13669,14 @@ func TestFlattenMapOnpremSchedule(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOnpremSchedule(p, d)[0] - expectedOp := map[string]interface{}{"month_of_year": 32, "day_of_week": 32, "repeat_interval": 32, "week_of_month": 32, "class_id": "onprem.Schedule", "object_type": "onprem.Schedule", "time_of_day": 32, "time_zone": "TimeZone 1", "day_of_month": 32} + expectedOp := map[string]interface{}{"week_of_month": 32, "repeat_interval": 32, "time_of_day": 32, "object_type": "onprem.Schedule", "day_of_month": 32, "time_zone": "TimeZone 1", "day_of_week": 32, "month_of_year": 32, "class_id": "onprem.Schedule"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOnpremUpgradePhase(t *testing.T) { p := models.OnpremUpgradePhase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"onprem.UpgradePhase","Message":"Message %d","Name":"Name %d","ElapsedTime":32,"Failed":true,"ClassId":"onprem.UpgradePhase"}` + c := `{"ClassId":"onprem.UpgradePhase","ElapsedTime":32,"Message":"Message %d","ObjectType":"onprem.UpgradePhase","Failed":true,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapOnpremUpgradePhase(p, d) @@ -13687,7 +13687,7 @@ func TestFlattenMapOnpremUpgradePhase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOnpremUpgradePhase(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "onprem.UpgradePhase", "message": "Message 1", "name": "Name 1", "elapsed_time": 32, "failed": true, "class_id": "onprem.UpgradePhase"} + expectedOp := map[string]interface{}{"class_id": "onprem.UpgradePhase", "elapsed_time": 32, "message": "Message 1", "object_type": "onprem.UpgradePhase", "failed": true, "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13712,7 +13712,7 @@ func TestFlattenMapOrganizationOrganizationRelationship(t *testing.T) { func TestFlattenMapOsAnswers(t *testing.T) { p := models.OsAnswers{} var d = &schema.ResourceData{} - c := `{"ProductKey":"ProductKey %d","IsRootPasswordSet":true,"Source":"Source %d","Nameserver":"Nameserver %d","IsRootPasswordCrypted":true,"ClassId":"os.Answers","IpConfigType":"IpConfigType %d","IsAnswerFileSet":true,"ObjectType":"os.Answers","Hostname":"Hostname %d"}` + c := `{"IpConfigType":"IpConfigType %d","IsRootPasswordSet":true,"IsAnswerFileSet":true,"ProductKey":"ProductKey %d","Source":"Source %d","ObjectType":"os.Answers","ClassId":"os.Answers","Hostname":"Hostname %d","Nameserver":"Nameserver %d","IsRootPasswordCrypted":true}` //test when the response is empty ffOpEmpty := flattenMapOsAnswers(p, d) @@ -13723,14 +13723,14 @@ func TestFlattenMapOsAnswers(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsAnswers(p, d)[0] - expectedOp := map[string]interface{}{"product_key": "ProductKey 1", "is_root_password_set": true, "nr_source": "Source 1", "nameserver": "Nameserver 1", "is_root_password_crypted": true, "class_id": "os.Answers", "ip_config_type": "IpConfigType 1", "is_answer_file_set": true, "object_type": "os.Answers", "hostname": "Hostname 1"} + expectedOp := map[string]interface{}{"ip_config_type": "IpConfigType 1", "is_root_password_set": true, "is_answer_file_set": true, "product_key": "ProductKey 1", "nr_source": "Source 1", "object_type": "os.Answers", "class_id": "os.Answers", "hostname": "Hostname 1", "nameserver": "Nameserver 1", "is_root_password_crypted": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsCatalogRelationship(t *testing.T) { p := models.OsCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapOsCatalogRelationship(p, d) @@ -13741,7 +13741,7 @@ func TestFlattenMapOsCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13766,7 +13766,7 @@ func TestFlattenMapOsConfigurationFileRelationship(t *testing.T) { func TestFlattenMapOsGlobalConfig(t *testing.T) { p := models.OsGlobalConfig{} var d = &schema.ResourceData{} - c := `{"ConfigurationFileName":"ConfigurationFileName %d","OsImageName":"OsImageName %d","ObjectType":"os.GlobalConfig","WindowsEdition":"WindowsEdition %d","InstallTargetType":"InstallTargetType %d","ConfigurationSource":"ConfigurationSource %d","InstallMethod":"InstallMethod %d","ClassId":"os.GlobalConfig","ScuImageName":"ScuImageName %d"}` + c := `{"ClassId":"os.GlobalConfig","OsImageName":"OsImageName %d","ConfigurationSource":"ConfigurationSource %d","ObjectType":"os.GlobalConfig","InstallMethod":"InstallMethod %d","ConfigurationFileName":"ConfigurationFileName %d","InstallTargetType":"InstallTargetType %d","ScuImageName":"ScuImageName %d","WindowsEdition":"WindowsEdition %d"}` //test when the response is empty ffOpEmpty := flattenMapOsGlobalConfig(p, d) @@ -13777,14 +13777,14 @@ func TestFlattenMapOsGlobalConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsGlobalConfig(p, d)[0] - expectedOp := map[string]interface{}{"configuration_file_name": "ConfigurationFileName 1", "os_image_name": "OsImageName 1", "object_type": "os.GlobalConfig", "windows_edition": "WindowsEdition 1", "install_target_type": "InstallTargetType 1", "configuration_source": "ConfigurationSource 1", "install_method": "InstallMethod 1", "class_id": "os.GlobalConfig", "scu_image_name": "ScuImageName 1"} + expectedOp := map[string]interface{}{"class_id": "os.GlobalConfig", "os_image_name": "OsImageName 1", "configuration_source": "ConfigurationSource 1", "object_type": "os.GlobalConfig", "install_method": "InstallMethod 1", "configuration_file_name": "ConfigurationFileName 1", "install_target_type": "InstallTargetType 1", "scu_image_name": "ScuImageName 1", "windows_edition": "WindowsEdition 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsInstallTarget(t *testing.T) { p := models.OsInstallTarget{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.InstallTarget","ObjectType":"os.InstallTarget"}` + c := `{"ObjectType":"os.InstallTarget","ClassId":"os.InstallTarget"}` //test when the response is empty ffOpEmpty := flattenMapOsInstallTarget(p, d) @@ -13795,14 +13795,14 @@ func TestFlattenMapOsInstallTarget(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsInstallTarget(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "os.InstallTarget", "object_type": "os.InstallTarget"} + expectedOp := map[string]interface{}{"object_type": "os.InstallTarget", "class_id": "os.InstallTarget"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsOperatingSystemParameters(t *testing.T) { p := models.OsOperatingSystemParameters{} var d = &schema.ResourceData{} - c := `{"ObjectType":"os.OperatingSystemParameters","ClassId":"os.OperatingSystemParameters"}` + c := `{"ClassId":"os.OperatingSystemParameters","ObjectType":"os.OperatingSystemParameters"}` //test when the response is empty ffOpEmpty := flattenMapOsOperatingSystemParameters(p, d) @@ -13813,14 +13813,14 @@ func TestFlattenMapOsOperatingSystemParameters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsOperatingSystemParameters(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "os.OperatingSystemParameters", "class_id": "os.OperatingSystemParameters"} + expectedOp := map[string]interface{}{"class_id": "os.OperatingSystemParameters", "object_type": "os.OperatingSystemParameters"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPciSwitchRelationship(t *testing.T) { p := models.PciSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPciSwitchRelationship(p, d) @@ -13831,14 +13831,14 @@ func TestFlattenMapPciSwitchRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPciSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPkixDistinguishedName(t *testing.T) { p := models.PkixDistinguishedName{} var d = &schema.ResourceData{} - c := `{"CommonName":"CommonName %d","ClassId":"pkix.DistinguishedName","ObjectType":"pkix.DistinguishedName"}` + c := `{"ClassId":"pkix.DistinguishedName","CommonName":"CommonName %d","ObjectType":"pkix.DistinguishedName"}` //test when the response is empty ffOpEmpty := flattenMapPkixDistinguishedName(p, d) @@ -13849,14 +13849,14 @@ func TestFlattenMapPkixDistinguishedName(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPkixDistinguishedName(p, d)[0] - expectedOp := map[string]interface{}{"common_name": "CommonName 1", "class_id": "pkix.DistinguishedName", "object_type": "pkix.DistinguishedName"} + expectedOp := map[string]interface{}{"class_id": "pkix.DistinguishedName", "common_name": "CommonName 1", "object_type": "pkix.DistinguishedName"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPkixKeyGenerationSpec(t *testing.T) { p := models.PkixKeyGenerationSpec{} var d = &schema.ResourceData{} - c := `{"ClassId":"pkix.KeyGenerationSpec","ObjectType":"pkix.KeyGenerationSpec","Name":"Name %d"}` + c := `{"Name":"Name %d","ClassId":"pkix.KeyGenerationSpec","ObjectType":"pkix.KeyGenerationSpec"}` //test when the response is empty ffOpEmpty := flattenMapPkixKeyGenerationSpec(p, d) @@ -13867,7 +13867,7 @@ func TestFlattenMapPkixKeyGenerationSpec(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPkixKeyGenerationSpec(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "pkix.KeyGenerationSpec", "object_type": "pkix.KeyGenerationSpec", "name": "Name 1"} + expectedOp := map[string]interface{}{"name": "Name 1", "class_id": "pkix.KeyGenerationSpec", "object_type": "pkix.KeyGenerationSpec"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13892,7 +13892,7 @@ func TestFlattenMapPkixSubjectAlternateName(t *testing.T) { func TestFlattenMapPolicyAbstractConfigProfileRelationship(t *testing.T) { p := models.PolicyAbstractConfigProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPolicyAbstractConfigProfileRelationship(p, d) @@ -13903,14 +13903,14 @@ func TestFlattenMapPolicyAbstractConfigProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyAbstractConfigProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyAbstractProfileRelationship(t *testing.T) { p := models.PolicyAbstractProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyAbstractProfileRelationship(p, d) @@ -13921,14 +13921,14 @@ func TestFlattenMapPolicyAbstractProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyAbstractProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigChange(t *testing.T) { p := models.PolicyConfigChange{} var d = &schema.ResourceData{} - c := `{"ClassId":"policy.ConfigChange","ObjectType":"policy.ConfigChange"}` + c := `{"ObjectType":"policy.ConfigChange","ClassId":"policy.ConfigChange"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigChange(p, d) @@ -13939,14 +13939,14 @@ func TestFlattenMapPolicyConfigChange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigChange(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "policy.ConfigChange", "object_type": "policy.ConfigChange"} + expectedOp := map[string]interface{}{"object_type": "policy.ConfigChange", "class_id": "policy.ConfigChange"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigChangeContext(t *testing.T) { p := models.PolicyConfigChangeContext{} var d = &schema.ResourceData{} - c := `{"ClassId":"policy.ConfigChangeContext","ConfigChangeError":"ConfigChangeError %d","ConfigChangeState":"ConfigChangeState %d","ObjectType":"policy.ConfigChangeContext"}` + c := `{"ConfigChangeState":"ConfigChangeState %d","ClassId":"policy.ConfigChangeContext","ObjectType":"policy.ConfigChangeContext","ConfigChangeError":"ConfigChangeError %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigChangeContext(p, d) @@ -13957,14 +13957,14 @@ func TestFlattenMapPolicyConfigChangeContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigChangeContext(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "policy.ConfigChangeContext", "config_change_error": "ConfigChangeError 1", "config_change_state": "ConfigChangeState 1", "object_type": "policy.ConfigChangeContext"} + expectedOp := map[string]interface{}{"config_change_state": "ConfigChangeState 1", "class_id": "policy.ConfigChangeContext", "object_type": "policy.ConfigChangeContext", "config_change_error": "ConfigChangeError 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigContext(t *testing.T) { p := models.PolicyConfigContext{} var d = &schema.ResourceData{} - c := `{"ConfigType":"ConfigType %d","ControlAction":"ControlAction %d","ClassId":"policy.ConfigContext","ObjectType":"policy.ConfigContext","ErrorState":"ErrorState %d","OperState":"OperState %d","ConfigState":"ConfigState %d"}` + c := `{"ConfigState":"ConfigState %d","ConfigType":"ConfigType %d","ControlAction":"ControlAction %d","ObjectType":"policy.ConfigContext","ClassId":"policy.ConfigContext","ErrorState":"ErrorState %d","OperState":"OperState %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigContext(p, d) @@ -13975,14 +13975,14 @@ func TestFlattenMapPolicyConfigContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigContext(p, d)[0] - expectedOp := map[string]interface{}{"config_type": "ConfigType 1", "control_action": "ControlAction 1", "class_id": "policy.ConfigContext", "object_type": "policy.ConfigContext", "error_state": "ErrorState 1", "oper_state": "OperState 1", "config_state": "ConfigState 1"} + expectedOp := map[string]interface{}{"config_state": "ConfigState 1", "config_type": "ConfigType 1", "control_action": "ControlAction 1", "object_type": "policy.ConfigContext", "class_id": "policy.ConfigContext", "error_state": "ErrorState 1", "oper_state": "OperState 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigResultContext(t *testing.T) { p := models.PolicyConfigResultContext{} var d = &schema.ResourceData{} - c := `{"ObjectType":"policy.ConfigResultContext","EntityName":"EntityName %d","EntityType":"EntityType %d","EntityMoid":"EntityMoid %d","ClassId":"policy.ConfigResultContext"}` + c := `{"ClassId":"policy.ConfigResultContext","ObjectType":"policy.ConfigResultContext","EntityMoid":"EntityMoid %d","EntityName":"EntityName %d","EntityType":"EntityType %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigResultContext(p, d) @@ -13993,14 +13993,14 @@ func TestFlattenMapPolicyConfigResultContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigResultContext(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "policy.ConfigResultContext", "entity_name": "EntityName 1", "entity_type": "EntityType 1", "entity_moid": "EntityMoid 1", "class_id": "policy.ConfigResultContext"} + expectedOp := map[string]interface{}{"class_id": "policy.ConfigResultContext", "object_type": "policy.ConfigResultContext", "entity_moid": "EntityMoid 1", "entity_name": "EntityName 1", "entity_type": "EntityType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPortGroupRelationship(t *testing.T) { p := models.PortGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPortGroupRelationship(p, d) @@ -14011,14 +14011,14 @@ func TestFlattenMapPortGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPortGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPortInterfaceBaseRelationship(t *testing.T) { p := models.PortInterfaceBaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapPortInterfaceBaseRelationship(p, d) @@ -14029,7 +14029,7 @@ func TestFlattenMapPortInterfaceBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPortInterfaceBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14054,7 +14054,7 @@ func TestFlattenMapPortSubGroupRelationship(t *testing.T) { func TestFlattenMapPowerControlStateRelationship(t *testing.T) { p := models.PowerControlStateRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapPowerControlStateRelationship(p, d) @@ -14065,14 +14065,14 @@ func TestFlattenMapPowerControlStateRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPowerControlStateRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecommendationCapacityRunwayRelationship(t *testing.T) { p := models.RecommendationCapacityRunwayRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecommendationCapacityRunwayRelationship(p, d) @@ -14083,14 +14083,14 @@ func TestFlattenMapRecommendationCapacityRunwayRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecommendationCapacityRunwayRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryAbstractBackupInfoRelationship(t *testing.T) { p := models.RecoveryAbstractBackupInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryAbstractBackupInfoRelationship(p, d) @@ -14101,7 +14101,7 @@ func TestFlattenMapRecoveryAbstractBackupInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryAbstractBackupInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14144,7 +14144,7 @@ func TestFlattenMapRecoveryBackupProfileRelationship(t *testing.T) { func TestFlattenMapRecoveryBackupSchedule(t *testing.T) { p := models.RecoveryBackupSchedule{} var d = &schema.ResourceData{} - c := `{"FrequencyUnit":"FrequencyUnit %d","Hours":32,"ClassId":"recovery.BackupSchedule","ObjectType":"recovery.BackupSchedule"}` + c := `{"ClassId":"recovery.BackupSchedule","ObjectType":"recovery.BackupSchedule","FrequencyUnit":"FrequencyUnit %d","Hours":32}` //test when the response is empty ffOpEmpty := flattenMapRecoveryBackupSchedule(p, d) @@ -14155,14 +14155,14 @@ func TestFlattenMapRecoveryBackupSchedule(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryBackupSchedule(p, d)[0] - expectedOp := map[string]interface{}{"frequency_unit": "FrequencyUnit 1", "hours": 32, "class_id": "recovery.BackupSchedule", "object_type": "recovery.BackupSchedule"} + expectedOp := map[string]interface{}{"class_id": "recovery.BackupSchedule", "object_type": "recovery.BackupSchedule", "frequency_unit": "FrequencyUnit 1", "hours": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryConfigParams(t *testing.T) { p := models.RecoveryConfigParams{} var d = &schema.ResourceData{} - c := `{"ClassId":"recovery.ConfigParams","ObjectType":"recovery.ConfigParams"}` + c := `{"ObjectType":"recovery.ConfigParams","ClassId":"recovery.ConfigParams"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryConfigParams(p, d) @@ -14173,14 +14173,14 @@ func TestFlattenMapRecoveryConfigParams(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryConfigParams(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "recovery.ConfigParams", "object_type": "recovery.ConfigParams"} + expectedOp := map[string]interface{}{"object_type": "recovery.ConfigParams", "class_id": "recovery.ConfigParams"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryConfigResultRelationship(t *testing.T) { p := models.RecoveryConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryConfigResultRelationship(p, d) @@ -14191,14 +14191,14 @@ func TestFlattenMapRecoveryConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryScheduleConfigPolicyRelationship(t *testing.T) { p := models.RecoveryScheduleConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryScheduleConfigPolicyRelationship(p, d) @@ -14209,14 +14209,14 @@ func TestFlattenMapRecoveryScheduleConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryScheduleConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapResourceGroupRelationship(t *testing.T) { p := models.ResourceGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapResourceGroupRelationship(p, d) @@ -14227,14 +14227,14 @@ func TestFlattenMapResourceGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourceGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapResourceMembershipHolderRelationship(t *testing.T) { p := models.ResourceMembershipHolderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapResourceMembershipHolderRelationship(p, d) @@ -14245,14 +14245,14 @@ func TestFlattenMapResourceMembershipHolderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourceMembershipHolderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSdwanProfileRelationship(t *testing.T) { p := models.SdwanProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSdwanProfileRelationship(p, d) @@ -14263,14 +14263,14 @@ func TestFlattenMapSdwanProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSdwanProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSdwanRouterPolicyRelationship(t *testing.T) { p := models.SdwanRouterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapSdwanRouterPolicyRelationship(p, d) @@ -14281,14 +14281,14 @@ func TestFlattenMapSdwanRouterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSdwanRouterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSdwanVmanageAccountPolicyRelationship(t *testing.T) { p := models.SdwanVmanageAccountPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSdwanVmanageAccountPolicyRelationship(p, d) @@ -14299,7 +14299,7 @@ func TestFlattenMapSdwanVmanageAccountPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSdwanVmanageAccountPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14324,7 +14324,7 @@ func TestFlattenMapServerConfigResultRelationship(t *testing.T) { func TestFlattenMapServerProfileRelationship(t *testing.T) { p := models.ServerProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapServerProfileRelationship(p, d) @@ -14335,14 +14335,14 @@ func TestFlattenMapServerProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapServerProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSessionAbstractSessionRelationship(t *testing.T) { p := models.SessionAbstractSessionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSessionAbstractSessionRelationship(p, d) @@ -14353,7 +14353,7 @@ func TestFlattenMapSessionAbstractSessionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSessionAbstractSessionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14378,7 +14378,7 @@ func TestFlattenMapSoftwareHyperflexDistributableRelationship(t *testing.T) { func TestFlattenMapSoftwareSolutionDistributableRelationship(t *testing.T) { p := models.SoftwareSolutionDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapSoftwareSolutionDistributableRelationship(p, d) @@ -14389,14 +14389,14 @@ func TestFlattenMapSoftwareSolutionDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwareSolutionDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwarerepositoryCatalogRelationship(t *testing.T) { p := models.SoftwarerepositoryCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryCatalogRelationship(p, d) @@ -14407,14 +14407,14 @@ func TestFlattenMapSoftwarerepositoryCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwarerepositoryFileRelationship(t *testing.T) { p := models.SoftwarerepositoryFileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryFileRelationship(p, d) @@ -14425,14 +14425,14 @@ func TestFlattenMapSoftwarerepositoryFileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryFileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwarerepositoryFileServer(t *testing.T) { p := models.SoftwarerepositoryFileServer{} var d = &schema.ResourceData{} - c := `{"ClassId":"softwarerepository.FileServer","ObjectType":"softwarerepository.FileServer"}` + c := `{"ObjectType":"softwarerepository.FileServer","ClassId":"softwarerepository.FileServer"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryFileServer(p, d) @@ -14443,14 +14443,14 @@ func TestFlattenMapSoftwarerepositoryFileServer(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryFileServer(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "softwarerepository.FileServer", "object_type": "softwarerepository.FileServer"} + expectedOp := map[string]interface{}{"object_type": "softwarerepository.FileServer", "class_id": "softwarerepository.FileServer"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwarerepositoryOperatingSystemFileRelationship(t *testing.T) { p := models.SoftwarerepositoryOperatingSystemFileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryOperatingSystemFileRelationship(p, d) @@ -14461,14 +14461,14 @@ func TestFlattenMapSoftwarerepositoryOperatingSystemFileRelationship(t *testing. err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryOperatingSystemFileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwarerepositoryReleaseRelationship(t *testing.T) { p := models.SoftwarerepositoryReleaseRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryReleaseRelationship(p, d) @@ -14479,14 +14479,14 @@ func TestFlattenMapSoftwarerepositoryReleaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryReleaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageAutomaticDriveGroup(t *testing.T) { p := models.StorageAutomaticDriveGroup{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.AutomaticDriveGroup","DrivesPerSpan":32,"MinimumDriveSize":32,"NumDedicatedHotSpares":"NumDedicatedHotSpares %d","NumberOfSpans":32,"UseRemainingDrives":true,"ObjectType":"storage.AutomaticDriveGroup","DriveType":"DriveType %d"}` + c := `{"ObjectType":"storage.AutomaticDriveGroup","NumberOfSpans":32,"MinimumDriveSize":32,"ClassId":"storage.AutomaticDriveGroup","UseRemainingDrives":true,"DriveType":"DriveType %d","DrivesPerSpan":32,"NumDedicatedHotSpares":"NumDedicatedHotSpares %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageAutomaticDriveGroup(p, d) @@ -14497,14 +14497,14 @@ func TestFlattenMapStorageAutomaticDriveGroup(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageAutomaticDriveGroup(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "storage.AutomaticDriveGroup", "drives_per_span": 32, "minimum_drive_size": 32, "num_dedicated_hot_spares": "NumDedicatedHotSpares 1", "number_of_spans": 32, "use_remaining_drives": true, "object_type": "storage.AutomaticDriveGroup", "drive_type": "DriveType 1"} + expectedOp := map[string]interface{}{"object_type": "storage.AutomaticDriveGroup", "number_of_spans": 32, "minimum_drive_size": 32, "class_id": "storage.AutomaticDriveGroup", "use_remaining_drives": true, "drive_type": "DriveType 1", "drives_per_span": 32, "num_dedicated_hot_spares": "NumDedicatedHotSpares 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageBaseCapacity(t *testing.T) { p := models.StorageBaseCapacity{} var d = &schema.ResourceData{} - c := `{"Total":32,"Used":32,"ClassId":"storage.BaseCapacity","ObjectType":"storage.BaseCapacity","Available":32,"CapacityUtilization":32.000000,"Free":32}` + c := `{"Available":32,"CapacityUtilization":32.000000,"Free":32,"Total":32,"Used":32,"ObjectType":"storage.BaseCapacity","ClassId":"storage.BaseCapacity"}` //test when the response is empty ffOpEmpty := flattenMapStorageBaseCapacity(p, d) @@ -14515,14 +14515,14 @@ func TestFlattenMapStorageBaseCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageBaseCapacity(p, d)[0] - expectedOp := map[string]interface{}{"total": 32, "used": 32, "class_id": "storage.BaseCapacity", "object_type": "storage.BaseCapacity", "available": 32, "capacity_utilization": 32.000000, "free": 32} + expectedOp := map[string]interface{}{"available": 32, "capacity_utilization": 32.000000, "free": 32, "total": 32, "used": 32, "object_type": "storage.BaseCapacity", "class_id": "storage.BaseCapacity"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageControllerRelationship(t *testing.T) { p := models.StorageControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageControllerRelationship(p, d) @@ -14533,14 +14533,14 @@ func TestFlattenMapStorageControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageDiskGroupRelationship(t *testing.T) { p := models.StorageDiskGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageDiskGroupRelationship(p, d) @@ -14551,14 +14551,14 @@ func TestFlattenMapStorageDiskGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageDiskGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageEnclosureRelationship(t *testing.T) { p := models.StorageEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageEnclosureRelationship(p, d) @@ -14569,14 +14569,14 @@ func TestFlattenMapStorageEnclosureRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageEnclosureRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageFlexFlashControllerRelationship(t *testing.T) { p := models.StorageFlexFlashControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageFlexFlashControllerRelationship(p, d) @@ -14587,7 +14587,7 @@ func TestFlattenMapStorageFlexFlashControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageFlexFlashControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14612,7 +14612,7 @@ func TestFlattenMapStorageFlexUtilControllerRelationship(t *testing.T) { func TestFlattenMapStorageHitachiArrayRelationship(t *testing.T) { p := models.StorageHitachiArrayRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiArrayRelationship(p, d) @@ -14623,14 +14623,14 @@ func TestFlattenMapStorageHitachiArrayRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiArrayRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiHostRelationship(t *testing.T) { p := models.StorageHitachiHostRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiHostRelationship(p, d) @@ -14641,14 +14641,14 @@ func TestFlattenMapStorageHitachiHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiParityGroupRelationship(t *testing.T) { p := models.StorageHitachiParityGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiParityGroupRelationship(p, d) @@ -14659,14 +14659,14 @@ func TestFlattenMapStorageHitachiParityGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiParityGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiPoolRelationship(t *testing.T) { p := models.StorageHitachiPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiPoolRelationship(p, d) @@ -14677,14 +14677,14 @@ func TestFlattenMapStorageHitachiPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiVolumeRelationship(t *testing.T) { p := models.StorageHitachiVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiVolumeRelationship(p, d) @@ -14695,14 +14695,14 @@ func TestFlattenMapStorageHitachiVolumeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiVolumeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHyperFlexStorageContainerRelationship(t *testing.T) { p := models.StorageHyperFlexStorageContainerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHyperFlexStorageContainerRelationship(p, d) @@ -14713,14 +14713,14 @@ func TestFlattenMapStorageHyperFlexStorageContainerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHyperFlexStorageContainerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageM2VirtualDriveConfig(t *testing.T) { p := models.StorageM2VirtualDriveConfig{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.M2VirtualDriveConfig","ObjectType":"storage.M2VirtualDriveConfig","Enable":true,"ControllerSlot":"ControllerSlot %d"}` + c := `{"ClassId":"storage.M2VirtualDriveConfig","ObjectType":"storage.M2VirtualDriveConfig","ControllerSlot":"ControllerSlot %d","Enable":true}` //test when the response is empty ffOpEmpty := flattenMapStorageM2VirtualDriveConfig(p, d) @@ -14731,14 +14731,14 @@ func TestFlattenMapStorageM2VirtualDriveConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageM2VirtualDriveConfig(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "storage.M2VirtualDriveConfig", "object_type": "storage.M2VirtualDriveConfig", "enable": true, "controller_slot": "ControllerSlot 1"} + expectedOp := map[string]interface{}{"class_id": "storage.M2VirtualDriveConfig", "object_type": "storage.M2VirtualDriveConfig", "controller_slot": "ControllerSlot 1", "enable": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageManualDriveGroup(t *testing.T) { p := models.StorageManualDriveGroup{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.ManualDriveGroup","ObjectType":"storage.ManualDriveGroup","DedicatedHotSpares":"DedicatedHotSpares %d"}` + c := `{"ObjectType":"storage.ManualDriveGroup","ClassId":"storage.ManualDriveGroup","DedicatedHotSpares":"DedicatedHotSpares %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageManualDriveGroup(p, d) @@ -14749,14 +14749,14 @@ func TestFlattenMapStorageManualDriveGroup(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageManualDriveGroup(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "storage.ManualDriveGroup", "object_type": "storage.ManualDriveGroup", "dedicated_hot_spares": "DedicatedHotSpares 1"} + expectedOp := map[string]interface{}{"object_type": "storage.ManualDriveGroup", "class_id": "storage.ManualDriveGroup", "dedicated_hot_spares": "DedicatedHotSpares 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppClusterRelationship(t *testing.T) { p := models.StorageNetAppClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppClusterRelationship(p, d) @@ -14767,14 +14767,14 @@ func TestFlattenMapStorageNetAppClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppEthernetPortRelationship(t *testing.T) { p := models.StorageNetAppEthernetPortRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppEthernetPortRelationship(p, d) @@ -14785,7 +14785,7 @@ func TestFlattenMapStorageNetAppEthernetPortRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppEthernetPortRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14810,7 +14810,7 @@ func TestFlattenMapStorageNetAppFcPortRelationship(t *testing.T) { func TestFlattenMapStorageNetAppLunRelationship(t *testing.T) { p := models.StorageNetAppLunRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppLunRelationship(p, d) @@ -14821,7 +14821,7 @@ func TestFlattenMapStorageNetAppLunRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppLunRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14882,7 +14882,7 @@ func TestFlattenMapStorageNetAppVolumeRelationship(t *testing.T) { func TestFlattenMapStoragePhysicalDiskRelationship(t *testing.T) { p := models.StoragePhysicalDiskRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePhysicalDiskRelationship(p, d) @@ -14893,7 +14893,7 @@ func TestFlattenMapStoragePhysicalDiskRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePhysicalDiskRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14918,7 +14918,7 @@ func TestFlattenMapStoragePureArrayRelationship(t *testing.T) { func TestFlattenMapStoragePureControllerRelationship(t *testing.T) { p := models.StoragePureControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureControllerRelationship(p, d) @@ -14929,14 +14929,14 @@ func TestFlattenMapStoragePureControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureHostRelationship(t *testing.T) { p := models.StoragePureHostRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureHostRelationship(p, d) @@ -14947,14 +14947,14 @@ func TestFlattenMapStoragePureHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureHostGroupRelationship(t *testing.T) { p := models.StoragePureHostGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureHostGroupRelationship(p, d) @@ -14965,14 +14965,14 @@ func TestFlattenMapStoragePureHostGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureHostGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureProtectionGroupRelationship(t *testing.T) { p := models.StoragePureProtectionGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureProtectionGroupRelationship(p, d) @@ -14983,14 +14983,14 @@ func TestFlattenMapStoragePureProtectionGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureProtectionGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureProtectionGroupSnapshotRelationship(t *testing.T) { p := models.StoragePureProtectionGroupSnapshotRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureProtectionGroupSnapshotRelationship(p, d) @@ -15001,14 +15001,14 @@ func TestFlattenMapStoragePureProtectionGroupSnapshotRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureProtectionGroupSnapshotRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureVolumeRelationship(t *testing.T) { p := models.StoragePureVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureVolumeRelationship(p, d) @@ -15019,14 +15019,14 @@ func TestFlattenMapStoragePureVolumeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureVolumeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageR0Drive(t *testing.T) { p := models.StorageR0Drive{} var d = &schema.ResourceData{} - c := `{"DriveSlotsList":"DriveSlotsList %d","Enable":true,"ClassId":"storage.R0Drive","ObjectType":"storage.R0Drive","DriveSlots":"DriveSlots %d"}` + c := `{"ClassId":"storage.R0Drive","DriveSlots":"DriveSlots %d","DriveSlotsList":"DriveSlotsList %d","Enable":true,"ObjectType":"storage.R0Drive"}` //test when the response is empty ffOpEmpty := flattenMapStorageR0Drive(p, d) @@ -15037,14 +15037,14 @@ func TestFlattenMapStorageR0Drive(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageR0Drive(p, d)[0] - expectedOp := map[string]interface{}{"drive_slots_list": "DriveSlotsList 1", "enable": true, "class_id": "storage.R0Drive", "object_type": "storage.R0Drive", "drive_slots": "DriveSlots 1"} + expectedOp := map[string]interface{}{"class_id": "storage.R0Drive", "drive_slots": "DriveSlots 1", "drive_slots_list": "DriveSlotsList 1", "enable": true, "object_type": "storage.R0Drive"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageSasExpanderRelationship(t *testing.T) { p := models.StorageSasExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageSasExpanderRelationship(p, d) @@ -15055,7 +15055,7 @@ func TestFlattenMapStorageSasExpanderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageSasExpanderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15080,7 +15080,7 @@ func TestFlattenMapStorageStoragePolicyRelationship(t *testing.T) { func TestFlattenMapStorageVirtualDriveRelationship(t *testing.T) { p := models.StorageVirtualDriveRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageVirtualDriveRelationship(p, d) @@ -15091,14 +15091,14 @@ func TestFlattenMapStorageVirtualDriveRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageVirtualDriveRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageVirtualDriveContainerRelationship(t *testing.T) { p := models.StorageVirtualDriveContainerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageVirtualDriveContainerRelationship(p, d) @@ -15109,7 +15109,7 @@ func TestFlattenMapStorageVirtualDriveContainerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageVirtualDriveContainerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15152,7 +15152,7 @@ func TestFlattenMapTamBaseAdvisoryRelationship(t *testing.T) { func TestFlattenMapTamBaseAdvisoryDetails(t *testing.T) { p := models.TamBaseAdvisoryDetails{} var d = &schema.ResourceData{} - c := `{"Description":"Description %d","ClassId":"tam.BaseAdvisoryDetails","ObjectType":"tam.BaseAdvisoryDetails"}` + c := `{"ClassId":"tam.BaseAdvisoryDetails","ObjectType":"tam.BaseAdvisoryDetails","Description":"Description %d"}` //test when the response is empty ffOpEmpty := flattenMapTamBaseAdvisoryDetails(p, d) @@ -15163,7 +15163,7 @@ func TestFlattenMapTamBaseAdvisoryDetails(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapTamBaseAdvisoryDetails(p, d)[0] - expectedOp := map[string]interface{}{"description": "Description 1", "class_id": "tam.BaseAdvisoryDetails", "object_type": "tam.BaseAdvisoryDetails"} + expectedOp := map[string]interface{}{"class_id": "tam.BaseAdvisoryDetails", "object_type": "tam.BaseAdvisoryDetails", "description": "Description 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15188,7 +15188,7 @@ func TestFlattenMapTamSeverity(t *testing.T) { func TestFlattenMapTechsupportmanagementTechSupportBundleRelationship(t *testing.T) { p := models.TechsupportmanagementTechSupportBundleRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapTechsupportmanagementTechSupportBundleRelationship(p, d) @@ -15199,14 +15199,14 @@ func TestFlattenMapTechsupportmanagementTechSupportBundleRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapTechsupportmanagementTechSupportBundleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapTechsupportmanagementTechSupportStatusRelationship(t *testing.T) { p := models.TechsupportmanagementTechSupportStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapTechsupportmanagementTechSupportStatusRelationship(p, d) @@ -15217,7 +15217,7 @@ func TestFlattenMapTechsupportmanagementTechSupportStatusRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapTechsupportmanagementTechSupportStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15242,7 +15242,7 @@ func TestFlattenMapTopSystemRelationship(t *testing.T) { func TestFlattenMapUuidpoolBlockRelationship(t *testing.T) { p := models.UuidpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolBlockRelationship(p, d) @@ -15253,14 +15253,14 @@ func TestFlattenMapUuidpoolBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolPoolRelationship(t *testing.T) { p := models.UuidpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolPoolRelationship(p, d) @@ -15271,14 +15271,14 @@ func TestFlattenMapUuidpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolPoolMemberRelationship(t *testing.T) { p := models.UuidpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolPoolMemberRelationship(p, d) @@ -15289,7 +15289,7 @@ func TestFlattenMapUuidpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15314,7 +15314,7 @@ func TestFlattenMapUuidpoolUniverseRelationship(t *testing.T) { func TestFlattenMapUuidpoolUuidBlock(t *testing.T) { p := models.UuidpoolUuidBlock{} var d = &schema.ResourceData{} - c := `{"ObjectType":"uuidpool.UuidBlock","Size":32,"ClassId":"uuidpool.UuidBlock","To":"To %d","From":"From %d"}` + c := `{"ObjectType":"uuidpool.UuidBlock","To":"To %d","From":"From %d","Size":32,"ClassId":"uuidpool.UuidBlock"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolUuidBlock(p, d) @@ -15325,14 +15325,14 @@ func TestFlattenMapUuidpoolUuidBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolUuidBlock(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "uuidpool.UuidBlock", "size": 32, "class_id": "uuidpool.UuidBlock", "to": "To 1", "from": "From 1"} + expectedOp := map[string]interface{}{"object_type": "uuidpool.UuidBlock", "to": "To 1", "from": "From 1", "size": 32, "class_id": "uuidpool.UuidBlock"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolUuidLeaseRelationship(t *testing.T) { p := models.UuidpoolUuidLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolUuidLeaseRelationship(p, d) @@ -15343,14 +15343,14 @@ func TestFlattenMapUuidpoolUuidLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolUuidLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationActionInfo(t *testing.T) { p := models.VirtualizationActionInfo{} var d = &schema.ResourceData{} - c := `{"FailureReason":"FailureReason %d","Name":"Name %d","Status":"Status %d","ClassId":"virtualization.ActionInfo","ObjectType":"virtualization.ActionInfo"}` + c := `{"ClassId":"virtualization.ActionInfo","ObjectType":"virtualization.ActionInfo","FailureReason":"FailureReason %d","Name":"Name %d","Status":"Status %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationActionInfo(p, d) @@ -15361,14 +15361,14 @@ func TestFlattenMapVirtualizationActionInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationActionInfo(p, d)[0] - expectedOp := map[string]interface{}{"failure_reason": "FailureReason 1", "name": "Name 1", "status": "Status 1", "class_id": "virtualization.ActionInfo", "object_type": "virtualization.ActionInfo"} + expectedOp := map[string]interface{}{"class_id": "virtualization.ActionInfo", "object_type": "virtualization.ActionInfo", "failure_reason": "FailureReason 1", "name": "Name 1", "status": "Status 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationBaseClusterRelationship(t *testing.T) { p := models.VirtualizationBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseClusterRelationship(p, d) @@ -15379,14 +15379,14 @@ func TestFlattenMapVirtualizationBaseClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationBaseHostRelationship(t *testing.T) { p := models.VirtualizationBaseHostRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseHostRelationship(p, d) @@ -15397,7 +15397,7 @@ func TestFlattenMapVirtualizationBaseHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15440,7 +15440,7 @@ func TestFlattenMapVirtualizationBaseVirtualDiskRelationship(t *testing.T) { func TestFlattenMapVirtualizationBaseVirtualMachineRelationship(t *testing.T) { p := models.VirtualizationBaseVirtualMachineRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseVirtualMachineRelationship(p, d) @@ -15451,14 +15451,14 @@ func TestFlattenMapVirtualizationBaseVirtualMachineRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseVirtualMachineRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationBaseVmConfiguration(t *testing.T) { p := models.VirtualizationBaseVmConfiguration{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.BaseVmConfiguration","ObjectType":"virtualization.BaseVmConfiguration"}` + c := `{"ObjectType":"virtualization.BaseVmConfiguration","ClassId":"virtualization.BaseVmConfiguration"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseVmConfiguration(p, d) @@ -15469,14 +15469,14 @@ func TestFlattenMapVirtualizationBaseVmConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseVmConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.BaseVmConfiguration", "object_type": "virtualization.BaseVmConfiguration"} + expectedOp := map[string]interface{}{"object_type": "virtualization.BaseVmConfiguration", "class_id": "virtualization.BaseVmConfiguration"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCloudInitConfig(t *testing.T) { p := models.VirtualizationCloudInitConfig{} var d = &schema.ResourceData{} - c := `{"UserDataBase64Encoded":true,"ConfigType":"ConfigType %d","NetworkData":"NetworkData %d","NetworkDataBase64Encoded":true,"UserData":"UserData %d","ClassId":"virtualization.CloudInitConfig","ObjectType":"virtualization.CloudInitConfig"}` + c := `{"NetworkData":"NetworkData %d","NetworkDataBase64Encoded":true,"UserData":"UserData %d","UserDataBase64Encoded":true,"ClassId":"virtualization.CloudInitConfig","ObjectType":"virtualization.CloudInitConfig","ConfigType":"ConfigType %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCloudInitConfig(p, d) @@ -15487,14 +15487,14 @@ func TestFlattenMapVirtualizationCloudInitConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCloudInitConfig(p, d)[0] - expectedOp := map[string]interface{}{"user_data_base64_encoded": true, "config_type": "ConfigType 1", "network_data": "NetworkData 1", "network_data_base64_encoded": true, "user_data": "UserData 1", "class_id": "virtualization.CloudInitConfig", "object_type": "virtualization.CloudInitConfig"} + expectedOp := map[string]interface{}{"network_data": "NetworkData 1", "network_data_base64_encoded": true, "user_data": "UserData 1", "user_data_base64_encoded": true, "class_id": "virtualization.CloudInitConfig", "object_type": "virtualization.CloudInitConfig", "config_type": "ConfigType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationComputeCapacity(t *testing.T) { p := models.VirtualizationComputeCapacity{} var d = &schema.ResourceData{} - c := `{"Capacity":32,"Free":32,"Used":32,"ClassId":"virtualization.ComputeCapacity","ObjectType":"virtualization.ComputeCapacity"}` + c := `{"ObjectType":"virtualization.ComputeCapacity","ClassId":"virtualization.ComputeCapacity","Capacity":32,"Free":32,"Used":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationComputeCapacity(p, d) @@ -15505,14 +15505,14 @@ func TestFlattenMapVirtualizationComputeCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationComputeCapacity(p, d)[0] - expectedOp := map[string]interface{}{"capacity": 32, "free": 32, "used": 32, "class_id": "virtualization.ComputeCapacity", "object_type": "virtualization.ComputeCapacity"} + expectedOp := map[string]interface{}{"object_type": "virtualization.ComputeCapacity", "class_id": "virtualization.ComputeCapacity", "capacity": 32, "free": 32, "used": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCpuAllocation(t *testing.T) { p := models.VirtualizationCpuAllocation{} var d = &schema.ResourceData{} - c := `{"Used":32,"Free":32,"Reserved":32,"Total":32,"ClassId":"virtualization.CpuAllocation","ObjectType":"virtualization.CpuAllocation"}` + c := `{"Used":32,"ClassId":"virtualization.CpuAllocation","ObjectType":"virtualization.CpuAllocation","Free":32,"Reserved":32,"Total":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCpuAllocation(p, d) @@ -15523,14 +15523,14 @@ func TestFlattenMapVirtualizationCpuAllocation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCpuAllocation(p, d)[0] - expectedOp := map[string]interface{}{"used": 32, "free": 32, "reserved": 32, "total": 32, "class_id": "virtualization.CpuAllocation", "object_type": "virtualization.CpuAllocation"} + expectedOp := map[string]interface{}{"used": 32, "class_id": "virtualization.CpuAllocation", "object_type": "virtualization.CpuAllocation", "free": 32, "reserved": 32, "total": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCpuInfo(t *testing.T) { p := models.VirtualizationCpuInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.CpuInfo","Vendor":"Vendor %d","Cores":32,"Description":"Description %d","Sockets":32,"Speed":32,"ClassId":"virtualization.CpuInfo"}` + c := `{"ObjectType":"virtualization.CpuInfo","Speed":32,"Vendor":"Vendor %d","Cores":32,"Description":"Description %d","Sockets":32,"ClassId":"virtualization.CpuInfo"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCpuInfo(p, d) @@ -15541,14 +15541,14 @@ func TestFlattenMapVirtualizationCpuInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCpuInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "virtualization.CpuInfo", "vendor": "Vendor 1", "cores": 32, "description": "Description 1", "sockets": 32, "speed": 32, "class_id": "virtualization.CpuInfo"} + expectedOp := map[string]interface{}{"object_type": "virtualization.CpuInfo", "speed": 32, "vendor": "Vendor 1", "cores": 32, "description": "Description 1", "sockets": 32, "class_id": "virtualization.CpuInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationGuestInfo(t *testing.T) { p := models.VirtualizationGuestInfo{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","OperatingSystem":"OperatingSystem %d","Hostname":"Hostname %d","IpAddress":"IpAddress %d","ClassId":"virtualization.GuestInfo","ObjectType":"virtualization.GuestInfo"}` + c := `{"ObjectType":"virtualization.GuestInfo","ClassId":"virtualization.GuestInfo","Name":"Name %d","OperatingSystem":"OperatingSystem %d","Hostname":"Hostname %d","IpAddress":"IpAddress %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationGuestInfo(p, d) @@ -15559,14 +15559,14 @@ func TestFlattenMapVirtualizationGuestInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationGuestInfo(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "operating_system": "OperatingSystem 1", "hostname": "Hostname 1", "ip_address": "IpAddress 1", "class_id": "virtualization.GuestInfo", "object_type": "virtualization.GuestInfo"} + expectedOp := map[string]interface{}{"object_type": "virtualization.GuestInfo", "class_id": "virtualization.GuestInfo", "name": "Name 1", "operating_system": "OperatingSystem 1", "hostname": "Hostname 1", "ip_address": "IpAddress 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationMemoryAllocation(t *testing.T) { p := models.VirtualizationMemoryAllocation{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.MemoryAllocation","ObjectType":"virtualization.MemoryAllocation","Total":32,"Used":32,"Free":32,"Reserved":32}` + c := `{"Free":32,"Reserved":32,"Total":32,"Used":32,"ClassId":"virtualization.MemoryAllocation","ObjectType":"virtualization.MemoryAllocation"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationMemoryAllocation(p, d) @@ -15577,14 +15577,14 @@ func TestFlattenMapVirtualizationMemoryAllocation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationMemoryAllocation(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.MemoryAllocation", "object_type": "virtualization.MemoryAllocation", "total": 32, "used": 32, "free": 32, "reserved": 32} + expectedOp := map[string]interface{}{"free": 32, "reserved": 32, "total": 32, "used": 32, "class_id": "virtualization.MemoryAllocation", "object_type": "virtualization.MemoryAllocation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationMemoryCapacity(t *testing.T) { p := models.VirtualizationMemoryCapacity{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.MemoryCapacity","ObjectType":"virtualization.MemoryCapacity","Used":32,"Capacity":32,"Free":32}` + c := `{"Free":32,"Used":32,"ClassId":"virtualization.MemoryCapacity","ObjectType":"virtualization.MemoryCapacity","Capacity":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationMemoryCapacity(p, d) @@ -15595,14 +15595,14 @@ func TestFlattenMapVirtualizationMemoryCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationMemoryCapacity(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.MemoryCapacity", "object_type": "virtualization.MemoryCapacity", "used": 32, "capacity": 32, "free": 32} + expectedOp := map[string]interface{}{"free": 32, "used": 32, "class_id": "virtualization.MemoryCapacity", "object_type": "virtualization.MemoryCapacity", "capacity": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationProductInfo(t *testing.T) { p := models.VirtualizationProductInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.ProductInfo","ClassId":"virtualization.ProductInfo","Build":"Build %d","ProductName":"ProductName %d","ProductType":"ProductType %d","ProductVendor":"ProductVendor %d","Version":"Version %d"}` + c := `{"ClassId":"virtualization.ProductInfo","ObjectType":"virtualization.ProductInfo","Build":"Build %d","ProductName":"ProductName %d","ProductType":"ProductType %d","ProductVendor":"ProductVendor %d","Version":"Version %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationProductInfo(p, d) @@ -15613,14 +15613,14 @@ func TestFlattenMapVirtualizationProductInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationProductInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "virtualization.ProductInfo", "class_id": "virtualization.ProductInfo", "build": "Build 1", "product_name": "ProductName 1", "product_type": "ProductType 1", "product_vendor": "ProductVendor 1", "nr_version": "Version 1"} + expectedOp := map[string]interface{}{"class_id": "virtualization.ProductInfo", "object_type": "virtualization.ProductInfo", "build": "Build 1", "product_name": "ProductName 1", "product_type": "ProductType 1", "product_vendor": "ProductVendor 1", "nr_version": "Version 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationStorageCapacity(t *testing.T) { p := models.VirtualizationStorageCapacity{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.StorageCapacity","ObjectType":"virtualization.StorageCapacity","Capacity":32,"Free":32,"Used":32}` + c := `{"ObjectType":"virtualization.StorageCapacity","Free":32,"Used":32,"Capacity":32,"ClassId":"virtualization.StorageCapacity"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationStorageCapacity(p, d) @@ -15631,14 +15631,14 @@ func TestFlattenMapVirtualizationStorageCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationStorageCapacity(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.StorageCapacity", "object_type": "virtualization.StorageCapacity", "capacity": 32, "free": 32, "used": 32} + expectedOp := map[string]interface{}{"object_type": "virtualization.StorageCapacity", "free": 32, "used": 32, "capacity": 32, "class_id": "virtualization.StorageCapacity"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVirtualMachineRelationship(t *testing.T) { p := models.VirtualizationVirtualMachineRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVirtualMachineRelationship(p, d) @@ -15649,14 +15649,14 @@ func TestFlattenMapVirtualizationVirtualMachineRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVirtualMachineRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareClusterRelationship(t *testing.T) { p := models.VirtualizationVmwareClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareClusterRelationship(p, d) @@ -15667,14 +15667,14 @@ func TestFlattenMapVirtualizationVmwareClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDatacenterRelationship(t *testing.T) { p := models.VirtualizationVmwareDatacenterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDatacenterRelationship(p, d) @@ -15685,14 +15685,14 @@ func TestFlattenMapVirtualizationVmwareDatacenterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDatacenterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDatastoreRelationship(t *testing.T) { p := models.VirtualizationVmwareDatastoreRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDatastoreRelationship(p, d) @@ -15703,14 +15703,14 @@ func TestFlattenMapVirtualizationVmwareDatastoreRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDatastoreRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDistributedNetworkRelationship(t *testing.T) { p := models.VirtualizationVmwareDistributedNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDistributedNetworkRelationship(p, d) @@ -15721,14 +15721,14 @@ func TestFlattenMapVirtualizationVmwareDistributedNetworkRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDistributedNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDistributedSwitchRelationship(t *testing.T) { p := models.VirtualizationVmwareDistributedSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDistributedSwitchRelationship(p, d) @@ -15739,7 +15739,7 @@ func TestFlattenMapVirtualizationVmwareDistributedSwitchRelationship(t *testing. err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDistributedSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15764,7 +15764,7 @@ func TestFlattenMapVirtualizationVmwareFolderRelationship(t *testing.T) { func TestFlattenMapVirtualizationVmwareHostRelationship(t *testing.T) { p := models.VirtualizationVmwareHostRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareHostRelationship(p, d) @@ -15775,14 +15775,14 @@ func TestFlattenMapVirtualizationVmwareHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareNetworkRelationship(t *testing.T) { p := models.VirtualizationVmwareNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareNetworkRelationship(p, d) @@ -15793,7 +15793,7 @@ func TestFlattenMapVirtualizationVmwareNetworkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15818,7 +15818,7 @@ func TestFlattenMapVirtualizationVmwarePhysicalNetworkInterfaceRelationship(t *t func TestFlattenMapVirtualizationVmwareRemoteDisplayInfo(t *testing.T) { p := models.VirtualizationVmwareRemoteDisplayInfo{} var d = &schema.ResourceData{} - c := `{"RemoteDisplayPassword":"RemoteDisplayPassword %d","RemoteDisplayVncKey":"RemoteDisplayVncKey %d","RemoteDisplayVncPort":32,"ClassId":"virtualization.VmwareRemoteDisplayInfo","ObjectType":"virtualization.VmwareRemoteDisplayInfo"}` + c := `{"RemoteDisplayVncKey":"RemoteDisplayVncKey %d","RemoteDisplayVncPort":32,"RemoteDisplayPassword":"RemoteDisplayPassword %d","ObjectType":"virtualization.VmwareRemoteDisplayInfo","ClassId":"virtualization.VmwareRemoteDisplayInfo"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareRemoteDisplayInfo(p, d) @@ -15829,14 +15829,14 @@ func TestFlattenMapVirtualizationVmwareRemoteDisplayInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareRemoteDisplayInfo(p, d)[0] - expectedOp := map[string]interface{}{"remote_display_password": "RemoteDisplayPassword 1", "remote_display_vnc_key": "RemoteDisplayVncKey 1", "remote_display_vnc_port": 32, "class_id": "virtualization.VmwareRemoteDisplayInfo", "object_type": "virtualization.VmwareRemoteDisplayInfo"} + expectedOp := map[string]interface{}{"remote_display_vnc_key": "RemoteDisplayVncKey 1", "remote_display_vnc_port": 32, "remote_display_password": "RemoteDisplayPassword 1", "object_type": "virtualization.VmwareRemoteDisplayInfo", "class_id": "virtualization.VmwareRemoteDisplayInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareResourceConsumption(t *testing.T) { p := models.VirtualizationVmwareResourceConsumption{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareResourceConsumption","ObjectType":"virtualization.VmwareResourceConsumption","CpuConsumed":32,"MemoryConsumed":32}` + c := `{"ObjectType":"virtualization.VmwareResourceConsumption","CpuConsumed":32,"MemoryConsumed":32,"ClassId":"virtualization.VmwareResourceConsumption"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareResourceConsumption(p, d) @@ -15847,14 +15847,14 @@ func TestFlattenMapVirtualizationVmwareResourceConsumption(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareResourceConsumption(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareResourceConsumption", "object_type": "virtualization.VmwareResourceConsumption", "cpu_consumed": 32, "memory_consumed": 32} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareResourceConsumption", "cpu_consumed": 32, "memory_consumed": 32, "class_id": "virtualization.VmwareResourceConsumption"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareSharesInfo(t *testing.T) { p := models.VirtualizationVmwareSharesInfo{} var d = &schema.ResourceData{} - c := `{"Level":"Level %d","Shares":32,"ClassId":"virtualization.VmwareSharesInfo","ObjectType":"virtualization.VmwareSharesInfo"}` + c := `{"ClassId":"virtualization.VmwareSharesInfo","ObjectType":"virtualization.VmwareSharesInfo","Level":"Level %d","Shares":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareSharesInfo(p, d) @@ -15865,14 +15865,14 @@ func TestFlattenMapVirtualizationVmwareSharesInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareSharesInfo(p, d)[0] - expectedOp := map[string]interface{}{"level": "Level 1", "shares": 32, "class_id": "virtualization.VmwareSharesInfo", "object_type": "virtualization.VmwareSharesInfo"} + expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareSharesInfo", "object_type": "virtualization.VmwareSharesInfo", "level": "Level 1", "shares": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareTeamingAndFailover(t *testing.T) { p := models.VirtualizationVmwareTeamingAndFailover{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","NotifySwitches":true,"ClassId":"virtualization.VmwareTeamingAndFailover","ObjectType":"virtualization.VmwareTeamingAndFailover","Failback":true,"NetworkFailureDetection":"NetworkFailureDetection %d","LoadBalancing":"LoadBalancing %d"}` + c := `{"NotifySwitches":true,"Name":"Name %d","ClassId":"virtualization.VmwareTeamingAndFailover","ObjectType":"virtualization.VmwareTeamingAndFailover","NetworkFailureDetection":"NetworkFailureDetection %d","Failback":true,"LoadBalancing":"LoadBalancing %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareTeamingAndFailover(p, d) @@ -15883,14 +15883,14 @@ func TestFlattenMapVirtualizationVmwareTeamingAndFailover(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareTeamingAndFailover(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "notify_switches": true, "class_id": "virtualization.VmwareTeamingAndFailover", "object_type": "virtualization.VmwareTeamingAndFailover", "failback": true, "network_failure_detection": "NetworkFailureDetection 1", "load_balancing": "LoadBalancing 1"} + expectedOp := map[string]interface{}{"notify_switches": true, "name": "Name 1", "class_id": "virtualization.VmwareTeamingAndFailover", "object_type": "virtualization.VmwareTeamingAndFailover", "network_failure_detection": "NetworkFailureDetection 1", "failback": true, "load_balancing": "LoadBalancing 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVcenterRelationship(t *testing.T) { p := models.VirtualizationVmwareVcenterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVcenterRelationship(p, d) @@ -15901,14 +15901,14 @@ func TestFlattenMapVirtualizationVmwareVcenterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVcenterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVirtualMachineRelationship(t *testing.T) { p := models.VirtualizationVmwareVirtualMachineRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVirtualMachineRelationship(p, d) @@ -15919,14 +15919,14 @@ func TestFlattenMapVirtualizationVmwareVirtualMachineRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVirtualMachineRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVirtualSwitchRelationship(t *testing.T) { p := models.VirtualizationVmwareVirtualSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVirtualSwitchRelationship(p, d) @@ -15937,14 +15937,14 @@ func TestFlattenMapVirtualizationVmwareVirtualSwitchRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVirtualSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmCpuShareInfo(t *testing.T) { p := models.VirtualizationVmwareVmCpuShareInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareVmCpuShareInfo","ObjectType":"virtualization.VmwareVmCpuShareInfo","CpuLimit":32,"CpuOverheadLimit":32,"CpuReservation":32,"CpuShares":32}` + c := `{"CpuLimit":32,"CpuOverheadLimit":32,"CpuReservation":32,"CpuShares":32,"ClassId":"virtualization.VmwareVmCpuShareInfo","ObjectType":"virtualization.VmwareVmCpuShareInfo"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmCpuShareInfo(p, d) @@ -15955,14 +15955,14 @@ func TestFlattenMapVirtualizationVmwareVmCpuShareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmCpuShareInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareVmCpuShareInfo", "object_type": "virtualization.VmwareVmCpuShareInfo", "cpu_limit": 32, "cpu_overhead_limit": 32, "cpu_reservation": 32, "cpu_shares": 32} + expectedOp := map[string]interface{}{"cpu_limit": 32, "cpu_overhead_limit": 32, "cpu_reservation": 32, "cpu_shares": 32, "class_id": "virtualization.VmwareVmCpuShareInfo", "object_type": "virtualization.VmwareVmCpuShareInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmCpuSocketInfo(t *testing.T) { p := models.VirtualizationVmwareVmCpuSocketInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareVmCpuSocketInfo","ObjectType":"virtualization.VmwareVmCpuSocketInfo","CoresPerSocket":32,"NumCpus":32,"NumSockets":32}` + c := `{"ObjectType":"virtualization.VmwareVmCpuSocketInfo","ClassId":"virtualization.VmwareVmCpuSocketInfo","NumCpus":32,"NumSockets":32,"CoresPerSocket":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmCpuSocketInfo(p, d) @@ -15973,14 +15973,14 @@ func TestFlattenMapVirtualizationVmwareVmCpuSocketInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmCpuSocketInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareVmCpuSocketInfo", "object_type": "virtualization.VmwareVmCpuSocketInfo", "cores_per_socket": 32, "num_cpus": 32, "num_sockets": 32} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareVmCpuSocketInfo", "class_id": "virtualization.VmwareVmCpuSocketInfo", "num_cpus": 32, "num_sockets": 32, "cores_per_socket": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmDiskCommitInfo(t *testing.T) { p := models.VirtualizationVmwareVmDiskCommitInfo{} var d = &schema.ResourceData{} - c := `{"CommittedDisk":32,"UnCommittedDisk":32,"UnsharedDisk":32,"ClassId":"virtualization.VmwareVmDiskCommitInfo","ObjectType":"virtualization.VmwareVmDiskCommitInfo"}` + c := `{"ObjectType":"virtualization.VmwareVmDiskCommitInfo","ClassId":"virtualization.VmwareVmDiskCommitInfo","CommittedDisk":32,"UnCommittedDisk":32,"UnsharedDisk":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmDiskCommitInfo(p, d) @@ -15991,14 +15991,14 @@ func TestFlattenMapVirtualizationVmwareVmDiskCommitInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmDiskCommitInfo(p, d)[0] - expectedOp := map[string]interface{}{"committed_disk": 32, "un_committed_disk": 32, "unshared_disk": 32, "class_id": "virtualization.VmwareVmDiskCommitInfo", "object_type": "virtualization.VmwareVmDiskCommitInfo"} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareVmDiskCommitInfo", "class_id": "virtualization.VmwareVmDiskCommitInfo", "committed_disk": 32, "un_committed_disk": 32, "unshared_disk": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmMemoryShareInfo(t *testing.T) { p := models.VirtualizationVmwareVmMemoryShareInfo{} var d = &schema.ResourceData{} - c := `{"MemLimit":32,"MemOverheadLimit":32,"MemReservation":32,"MemShares":32,"ClassId":"virtualization.VmwareVmMemoryShareInfo","ObjectType":"virtualization.VmwareVmMemoryShareInfo"}` + c := `{"MemShares":32,"ClassId":"virtualization.VmwareVmMemoryShareInfo","ObjectType":"virtualization.VmwareVmMemoryShareInfo","MemLimit":32,"MemOverheadLimit":32,"MemReservation":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmMemoryShareInfo(p, d) @@ -16009,14 +16009,14 @@ func TestFlattenMapVirtualizationVmwareVmMemoryShareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmMemoryShareInfo(p, d)[0] - expectedOp := map[string]interface{}{"mem_limit": 32, "mem_overhead_limit": 32, "mem_reservation": 32, "mem_shares": 32, "class_id": "virtualization.VmwareVmMemoryShareInfo", "object_type": "virtualization.VmwareVmMemoryShareInfo"} + expectedOp := map[string]interface{}{"mem_shares": 32, "class_id": "virtualization.VmwareVmMemoryShareInfo", "object_type": "virtualization.VmwareVmMemoryShareInfo", "mem_limit": 32, "mem_overhead_limit": 32, "mem_reservation": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicArfsSettings(t *testing.T) { p := models.VnicArfsSettings{} var d = &schema.ResourceData{} - c := `{"Enabled":true,"ClassId":"vnic.ArfsSettings","ObjectType":"vnic.ArfsSettings"}` + c := `{"ClassId":"vnic.ArfsSettings","ObjectType":"vnic.ArfsSettings","Enabled":true}` //test when the response is empty ffOpEmpty := flattenMapVnicArfsSettings(p, d) @@ -16027,14 +16027,14 @@ func TestFlattenMapVnicArfsSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicArfsSettings(p, d)[0] - expectedOp := map[string]interface{}{"enabled": true, "class_id": "vnic.ArfsSettings", "object_type": "vnic.ArfsSettings"} + expectedOp := map[string]interface{}{"class_id": "vnic.ArfsSettings", "object_type": "vnic.ArfsSettings", "enabled": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicCdn(t *testing.T) { p := models.VnicCdn{} var d = &schema.ResourceData{} - c := `{"Value":"Value %d","ClassId":"vnic.Cdn","ObjectType":"vnic.Cdn","Source":"Source %d"}` + c := `{"ObjectType":"vnic.Cdn","Value":"Value %d","Source":"Source %d","ClassId":"vnic.Cdn"}` //test when the response is empty ffOpEmpty := flattenMapVnicCdn(p, d) @@ -16045,14 +16045,14 @@ func TestFlattenMapVnicCdn(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicCdn(p, d)[0] - expectedOp := map[string]interface{}{"value": "Value 1", "class_id": "vnic.Cdn", "object_type": "vnic.Cdn", "nr_source": "Source 1"} + expectedOp := map[string]interface{}{"object_type": "vnic.Cdn", "value": "Value 1", "nr_source": "Source 1", "class_id": "vnic.Cdn"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicCompletionQueueSettings(t *testing.T) { p := models.VnicCompletionQueueSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.CompletionQueueSettings","ObjectType":"vnic.CompletionQueueSettings","Count":32,"RingSize":32}` + c := `{"Count":32,"ClassId":"vnic.CompletionQueueSettings","ObjectType":"vnic.CompletionQueueSettings","RingSize":32}` //test when the response is empty ffOpEmpty := flattenMapVnicCompletionQueueSettings(p, d) @@ -16063,14 +16063,14 @@ func TestFlattenMapVnicCompletionQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicCompletionQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.CompletionQueueSettings", "object_type": "vnic.CompletionQueueSettings", "nr_count": 32, "ring_size": 32} + expectedOp := map[string]interface{}{"nr_count": 32, "class_id": "vnic.CompletionQueueSettings", "object_type": "vnic.CompletionQueueSettings", "ring_size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicEthAdapterPolicyRelationship(t *testing.T) { p := models.VnicEthAdapterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthAdapterPolicyRelationship(p, d) @@ -16081,7 +16081,7 @@ func TestFlattenMapVnicEthAdapterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthAdapterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16106,7 +16106,7 @@ func TestFlattenMapVnicEthIfRelationship(t *testing.T) { func TestFlattenMapVnicEthInterruptSettings(t *testing.T) { p := models.VnicEthInterruptSettings{} var d = &schema.ResourceData{} - c := `{"Mode":"Mode %d","CoalescingTime":32,"CoalescingType":"CoalescingType %d","Count":32,"ClassId":"vnic.EthInterruptSettings","ObjectType":"vnic.EthInterruptSettings"}` + c := `{"CoalescingTime":32,"CoalescingType":"CoalescingType %d","Count":32,"Mode":"Mode %d","ObjectType":"vnic.EthInterruptSettings","ClassId":"vnic.EthInterruptSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthInterruptSettings(p, d) @@ -16117,7 +16117,7 @@ func TestFlattenMapVnicEthInterruptSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthInterruptSettings(p, d)[0] - expectedOp := map[string]interface{}{"mode": "Mode 1", "coalescing_time": 32, "coalescing_type": "CoalescingType 1", "nr_count": 32, "class_id": "vnic.EthInterruptSettings", "object_type": "vnic.EthInterruptSettings"} + expectedOp := map[string]interface{}{"coalescing_time": 32, "coalescing_type": "CoalescingType 1", "nr_count": 32, "mode": "Mode 1", "object_type": "vnic.EthInterruptSettings", "class_id": "vnic.EthInterruptSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16160,7 +16160,7 @@ func TestFlattenMapVnicEthQosPolicyRelationship(t *testing.T) { func TestFlattenMapVnicEthRxQueueSettings(t *testing.T) { p := models.VnicEthRxQueueSettings{} var d = &schema.ResourceData{} - c := `{"RingSize":32,"ClassId":"vnic.EthRxQueueSettings","ObjectType":"vnic.EthRxQueueSettings","Count":32}` + c := `{"ClassId":"vnic.EthRxQueueSettings","Count":32,"RingSize":32,"ObjectType":"vnic.EthRxQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthRxQueueSettings(p, d) @@ -16171,7 +16171,7 @@ func TestFlattenMapVnicEthRxQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthRxQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"ring_size": 32, "class_id": "vnic.EthRxQueueSettings", "object_type": "vnic.EthRxQueueSettings", "nr_count": 32} + expectedOp := map[string]interface{}{"class_id": "vnic.EthRxQueueSettings", "nr_count": 32, "ring_size": 32, "object_type": "vnic.EthRxQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16196,7 +16196,7 @@ func TestFlattenMapVnicEthTxQueueSettings(t *testing.T) { func TestFlattenMapVnicFcAdapterPolicyRelationship(t *testing.T) { p := models.VnicFcAdapterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcAdapterPolicyRelationship(p, d) @@ -16207,14 +16207,14 @@ func TestFlattenMapVnicFcAdapterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcAdapterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcErrorRecoverySettings(t *testing.T) { p := models.VnicFcErrorRecoverySettings{} var d = &schema.ResourceData{} - c := `{"IoRetryCount":32,"ClassId":"vnic.FcErrorRecoverySettings","ObjectType":"vnic.FcErrorRecoverySettings","IoRetryTimeout":32,"LinkDownTimeout":32,"PortDownTimeout":32,"Enabled":true}` + c := `{"IoRetryTimeout":32,"LinkDownTimeout":32,"ClassId":"vnic.FcErrorRecoverySettings","ObjectType":"vnic.FcErrorRecoverySettings","PortDownTimeout":32,"Enabled":true,"IoRetryCount":32}` //test when the response is empty ffOpEmpty := flattenMapVnicFcErrorRecoverySettings(p, d) @@ -16225,14 +16225,14 @@ func TestFlattenMapVnicFcErrorRecoverySettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcErrorRecoverySettings(p, d)[0] - expectedOp := map[string]interface{}{"io_retry_count": 32, "class_id": "vnic.FcErrorRecoverySettings", "object_type": "vnic.FcErrorRecoverySettings", "io_retry_timeout": 32, "link_down_timeout": 32, "port_down_timeout": 32, "enabled": true} + expectedOp := map[string]interface{}{"io_retry_timeout": 32, "link_down_timeout": 32, "class_id": "vnic.FcErrorRecoverySettings", "object_type": "vnic.FcErrorRecoverySettings", "port_down_timeout": 32, "enabled": true, "io_retry_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcIfRelationship(t *testing.T) { p := models.VnicFcIfRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcIfRelationship(p, d) @@ -16243,14 +16243,14 @@ func TestFlattenMapVnicFcIfRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcIfRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcInterruptSettings(t *testing.T) { p := models.VnicFcInterruptSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.FcInterruptSettings","Mode":"Mode %d","ClassId":"vnic.FcInterruptSettings"}` + c := `{"ClassId":"vnic.FcInterruptSettings","Mode":"Mode %d","ObjectType":"vnic.FcInterruptSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcInterruptSettings(p, d) @@ -16261,7 +16261,7 @@ func TestFlattenMapVnicFcInterruptSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcInterruptSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.FcInterruptSettings", "mode": "Mode 1", "class_id": "vnic.FcInterruptSettings"} + expectedOp := map[string]interface{}{"class_id": "vnic.FcInterruptSettings", "mode": "Mode 1", "object_type": "vnic.FcInterruptSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16304,7 +16304,7 @@ func TestFlattenMapVnicFcQosPolicyRelationship(t *testing.T) { func TestFlattenMapVnicFcQueueSettings(t *testing.T) { p := models.VnicFcQueueSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.FcQueueSettings","ObjectType":"vnic.FcQueueSettings","Count":32,"RingSize":32}` + c := `{"Count":32,"RingSize":32,"ObjectType":"vnic.FcQueueSettings","ClassId":"vnic.FcQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcQueueSettings(p, d) @@ -16315,7 +16315,7 @@ func TestFlattenMapVnicFcQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.FcQueueSettings", "object_type": "vnic.FcQueueSettings", "nr_count": 32, "ring_size": 32} + expectedOp := map[string]interface{}{"nr_count": 32, "ring_size": 32, "object_type": "vnic.FcQueueSettings", "class_id": "vnic.FcQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16340,7 +16340,7 @@ func TestFlattenMapVnicFlogiSettings(t *testing.T) { func TestFlattenMapVnicIscsiAdapterPolicyRelationship(t *testing.T) { p := models.VnicIscsiAdapterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiAdapterPolicyRelationship(p, d) @@ -16351,7 +16351,7 @@ func TestFlattenMapVnicIscsiAdapterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiAdapterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16376,7 +16376,7 @@ func TestFlattenMapVnicIscsiAuthProfile(t *testing.T) { func TestFlattenMapVnicIscsiBootPolicyRelationship(t *testing.T) { p := models.VnicIscsiBootPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiBootPolicyRelationship(p, d) @@ -16387,14 +16387,14 @@ func TestFlattenMapVnicIscsiBootPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiBootPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicIscsiStaticTargetPolicyRelationship(t *testing.T) { p := models.VnicIscsiStaticTargetPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiStaticTargetPolicyRelationship(p, d) @@ -16405,14 +16405,14 @@ func TestFlattenMapVnicIscsiStaticTargetPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiStaticTargetPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicLanConnectivityPolicyRelationship(t *testing.T) { p := models.VnicLanConnectivityPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicLanConnectivityPolicyRelationship(p, d) @@ -16423,14 +16423,14 @@ func TestFlattenMapVnicLanConnectivityPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicLanConnectivityPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicLun(t *testing.T) { p := models.VnicLun{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.Lun","ObjectType":"vnic.Lun","LunId":32,"Bootable":true}` + c := `{"Bootable":true,"LunId":32,"ClassId":"vnic.Lun","ObjectType":"vnic.Lun"}` //test when the response is empty ffOpEmpty := flattenMapVnicLun(p, d) @@ -16441,7 +16441,7 @@ func TestFlattenMapVnicLun(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicLun(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.Lun", "object_type": "vnic.Lun", "lun_id": 32, "bootable": true} + expectedOp := map[string]interface{}{"bootable": true, "lun_id": 32, "class_id": "vnic.Lun", "object_type": "vnic.Lun"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16466,7 +16466,7 @@ func TestFlattenMapVnicNvgreSettings(t *testing.T) { func TestFlattenMapVnicPlacementSettings(t *testing.T) { p := models.VnicPlacementSettings{} var d = &schema.ResourceData{} - c := `{"Uplink":32,"Id":"Id %d","ClassId":"vnic.PlacementSettings","ObjectType":"vnic.PlacementSettings","PciLink":32,"SwitchId":"SwitchId %d"}` + c := `{"PciLink":32,"SwitchId":"SwitchId %d","Uplink":32,"Id":"Id %d","ClassId":"vnic.PlacementSettings","ObjectType":"vnic.PlacementSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicPlacementSettings(p, d) @@ -16477,7 +16477,7 @@ func TestFlattenMapVnicPlacementSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicPlacementSettings(p, d)[0] - expectedOp := map[string]interface{}{"uplink": 32, "id": "Id 1", "class_id": "vnic.PlacementSettings", "object_type": "vnic.PlacementSettings", "pci_link": 32, "switch_id": "SwitchId 1"} + expectedOp := map[string]interface{}{"pci_link": 32, "switch_id": "SwitchId 1", "uplink": 32, "id": "Id 1", "class_id": "vnic.PlacementSettings", "object_type": "vnic.PlacementSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16502,7 +16502,7 @@ func TestFlattenMapVnicPlogiSettings(t *testing.T) { func TestFlattenMapVnicRoceSettings(t *testing.T) { p := models.VnicRoceSettings{} var d = &schema.ResourceData{} - c := `{"ClassOfService":32,"Enabled":true,"QueuePairs":32,"ResourceGroups":32,"ObjectType":"vnic.RoceSettings","ClassId":"vnic.RoceSettings","Version":32,"MemoryRegions":32}` + c := `{"Version":32,"ObjectType":"vnic.RoceSettings","QueuePairs":32,"ResourceGroups":32,"ClassOfService":32,"Enabled":true,"ClassId":"vnic.RoceSettings","MemoryRegions":32}` //test when the response is empty ffOpEmpty := flattenMapVnicRoceSettings(p, d) @@ -16513,14 +16513,14 @@ func TestFlattenMapVnicRoceSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicRoceSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_of_service": 32, "enabled": true, "queue_pairs": 32, "resource_groups": 32, "object_type": "vnic.RoceSettings", "class_id": "vnic.RoceSettings", "nr_version": 32, "memory_regions": 32} + expectedOp := map[string]interface{}{"nr_version": 32, "object_type": "vnic.RoceSettings", "queue_pairs": 32, "resource_groups": 32, "class_of_service": 32, "enabled": true, "class_id": "vnic.RoceSettings", "memory_regions": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicRssHashSettings(t *testing.T) { p := models.VnicRssHashSettings{} var d = &schema.ResourceData{} - c := `{"TcpIpv4Hash":true,"TcpIpv6ExtHash":true,"ObjectType":"vnic.RssHashSettings","Ipv4Hash":true,"Ipv6Hash":true,"UdpIpv6Hash":true,"ClassId":"vnic.RssHashSettings","TcpIpv6Hash":true,"Ipv6ExtHash":true,"UdpIpv4Hash":true}` + c := `{"UdpIpv6Hash":true,"Ipv4Hash":true,"UdpIpv4Hash":true,"TcpIpv6Hash":true,"ObjectType":"vnic.RssHashSettings","TcpIpv6ExtHash":true,"Ipv6ExtHash":true,"ClassId":"vnic.RssHashSettings","TcpIpv4Hash":true,"Ipv6Hash":true}` //test when the response is empty ffOpEmpty := flattenMapVnicRssHashSettings(p, d) @@ -16531,7 +16531,7 @@ func TestFlattenMapVnicRssHashSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicRssHashSettings(p, d)[0] - expectedOp := map[string]interface{}{"tcp_ipv4_hash": true, "tcp_ipv6_ext_hash": true, "object_type": "vnic.RssHashSettings", "ipv4_hash": true, "ipv6_hash": true, "udp_ipv6_hash": true, "class_id": "vnic.RssHashSettings", "tcp_ipv6_hash": true, "ipv6_ext_hash": true, "udp_ipv4_hash": true} + expectedOp := map[string]interface{}{"udp_ipv6_hash": true, "ipv4_hash": true, "udp_ipv4_hash": true, "tcp_ipv6_hash": true, "object_type": "vnic.RssHashSettings", "tcp_ipv6_ext_hash": true, "ipv6_ext_hash": true, "class_id": "vnic.RssHashSettings", "tcp_ipv4_hash": true, "ipv6_hash": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16556,7 +16556,7 @@ func TestFlattenMapVnicSanConnectivityPolicyRelationship(t *testing.T) { func TestFlattenMapVnicScsiQueueSettings(t *testing.T) { p := models.VnicScsiQueueSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.ScsiQueueSettings","ClassId":"vnic.ScsiQueueSettings","Count":32,"RingSize":32}` + c := `{"ClassId":"vnic.ScsiQueueSettings","Count":32,"RingSize":32,"ObjectType":"vnic.ScsiQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicScsiQueueSettings(p, d) @@ -16567,14 +16567,14 @@ func TestFlattenMapVnicScsiQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicScsiQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.ScsiQueueSettings", "class_id": "vnic.ScsiQueueSettings", "nr_count": 32, "ring_size": 32} + expectedOp := map[string]interface{}{"class_id": "vnic.ScsiQueueSettings", "nr_count": 32, "ring_size": 32, "object_type": "vnic.ScsiQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicTcpOffloadSettings(t *testing.T) { p := models.VnicTcpOffloadSettings{} var d = &schema.ResourceData{} - c := `{"LargeReceive":true,"LargeSend":true,"RxChecksum":true,"TxChecksum":true,"ClassId":"vnic.TcpOffloadSettings","ObjectType":"vnic.TcpOffloadSettings"}` + c := `{"RxChecksum":true,"TxChecksum":true,"LargeReceive":true,"LargeSend":true,"ClassId":"vnic.TcpOffloadSettings","ObjectType":"vnic.TcpOffloadSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicTcpOffloadSettings(p, d) @@ -16585,14 +16585,14 @@ func TestFlattenMapVnicTcpOffloadSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicTcpOffloadSettings(p, d)[0] - expectedOp := map[string]interface{}{"large_receive": true, "large_send": true, "rx_checksum": true, "tx_checksum": true, "class_id": "vnic.TcpOffloadSettings", "object_type": "vnic.TcpOffloadSettings"} + expectedOp := map[string]interface{}{"rx_checksum": true, "tx_checksum": true, "large_receive": true, "large_send": true, "class_id": "vnic.TcpOffloadSettings", "object_type": "vnic.TcpOffloadSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicUsnicSettings(t *testing.T) { p := models.VnicUsnicSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.UsnicSettings","Cos":32,"Count":32,"UsnicAdapterPolicy":"UsnicAdapterPolicy %d","ClassId":"vnic.UsnicSettings"}` + c := `{"UsnicAdapterPolicy":"UsnicAdapterPolicy %d","Cos":32,"ObjectType":"vnic.UsnicSettings","ClassId":"vnic.UsnicSettings","Count":32}` //test when the response is empty ffOpEmpty := flattenMapVnicUsnicSettings(p, d) @@ -16603,14 +16603,14 @@ func TestFlattenMapVnicUsnicSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicUsnicSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.UsnicSettings", "cos": 32, "nr_count": 32, "usnic_adapter_policy": "UsnicAdapterPolicy 1", "class_id": "vnic.UsnicSettings"} + expectedOp := map[string]interface{}{"usnic_adapter_policy": "UsnicAdapterPolicy 1", "cos": 32, "object_type": "vnic.UsnicSettings", "class_id": "vnic.UsnicSettings", "nr_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVlanSettings(t *testing.T) { p := models.VnicVlanSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.VlanSettings","AllowedVlans":"AllowedVlans %d","DefaultVlan":32,"Mode":"Mode %d","ClassId":"vnic.VlanSettings"}` + c := `{"ClassId":"vnic.VlanSettings","ObjectType":"vnic.VlanSettings","DefaultVlan":32,"Mode":"Mode %d","AllowedVlans":"AllowedVlans %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicVlanSettings(p, d) @@ -16621,14 +16621,14 @@ func TestFlattenMapVnicVlanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVlanSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.VlanSettings", "allowed_vlans": "AllowedVlans 1", "default_vlan": 32, "mode": "Mode 1", "class_id": "vnic.VlanSettings"} + expectedOp := map[string]interface{}{"class_id": "vnic.VlanSettings", "object_type": "vnic.VlanSettings", "default_vlan": 32, "mode": "Mode 1", "allowed_vlans": "AllowedVlans 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVmqSettings(t *testing.T) { p := models.VnicVmqSettings{} var d = &schema.ResourceData{} - c := `{"NumInterrupts":32,"NumSubVnics":32,"NumVmqs":32,"Enabled":true,"ClassId":"vnic.VmqSettings","ObjectType":"vnic.VmqSettings","MultiQueueSupport":true,"VmmqAdapterPolicy":"VmmqAdapterPolicy %d"}` + c := `{"ClassId":"vnic.VmqSettings","ObjectType":"vnic.VmqSettings","NumVmqs":32,"VmmqAdapterPolicy":"VmmqAdapterPolicy %d","NumSubVnics":32,"Enabled":true,"MultiQueueSupport":true,"NumInterrupts":32}` //test when the response is empty ffOpEmpty := flattenMapVnicVmqSettings(p, d) @@ -16639,14 +16639,14 @@ func TestFlattenMapVnicVmqSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVmqSettings(p, d)[0] - expectedOp := map[string]interface{}{"num_interrupts": 32, "num_sub_vnics": 32, "num_vmqs": 32, "enabled": true, "class_id": "vnic.VmqSettings", "object_type": "vnic.VmqSettings", "multi_queue_support": true, "vmmq_adapter_policy": "VmmqAdapterPolicy 1"} + expectedOp := map[string]interface{}{"class_id": "vnic.VmqSettings", "object_type": "vnic.VmqSettings", "num_vmqs": 32, "vmmq_adapter_policy": "VmmqAdapterPolicy 1", "num_sub_vnics": 32, "enabled": true, "multi_queue_support": true, "num_interrupts": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVsanSettings(t *testing.T) { p := models.VnicVsanSettings{} var d = &schema.ResourceData{} - c := `{"DefaultVlanId":32,"ClassId":"vnic.VsanSettings","ObjectType":"vnic.VsanSettings","Id":32}` + c := `{"ClassId":"vnic.VsanSettings","ObjectType":"vnic.VsanSettings","DefaultVlanId":32,"Id":32}` //test when the response is empty ffOpEmpty := flattenMapVnicVsanSettings(p, d) @@ -16657,14 +16657,14 @@ func TestFlattenMapVnicVsanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVsanSettings(p, d)[0] - expectedOp := map[string]interface{}{"default_vlan_id": 32, "class_id": "vnic.VsanSettings", "object_type": "vnic.VsanSettings", "id": 32} + expectedOp := map[string]interface{}{"class_id": "vnic.VsanSettings", "object_type": "vnic.VsanSettings", "default_vlan_id": 32, "id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVxlanSettings(t *testing.T) { p := models.VnicVxlanSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.VxlanSettings","Enabled":true,"ObjectType":"vnic.VxlanSettings"}` + c := `{"ClassId":"vnic.VxlanSettings","ObjectType":"vnic.VxlanSettings","Enabled":true}` //test when the response is empty ffOpEmpty := flattenMapVnicVxlanSettings(p, d) @@ -16675,14 +16675,14 @@ func TestFlattenMapVnicVxlanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVxlanSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.VxlanSettings", "enabled": true, "object_type": "vnic.VxlanSettings"} + expectedOp := map[string]interface{}{"class_id": "vnic.VxlanSettings", "object_type": "vnic.VxlanSettings", "enabled": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVrfVrfRelationship(t *testing.T) { p := models.VrfVrfRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVrfVrfRelationship(p, d) @@ -16693,14 +16693,14 @@ func TestFlattenMapVrfVrfRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVrfVrfRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowCatalogRelationship(t *testing.T) { p := models.WorkflowCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowCatalogRelationship(p, d) @@ -16711,7 +16711,7 @@ func TestFlattenMapWorkflowCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16772,7 +16772,7 @@ func TestFlattenMapWorkflowCustomDataTypeProperties(t *testing.T) { func TestFlattenMapWorkflowErrorResponseHandlerRelationship(t *testing.T) { p := models.WorkflowErrorResponseHandlerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowErrorResponseHandlerRelationship(p, d) @@ -16783,7 +16783,7 @@ func TestFlattenMapWorkflowErrorResponseHandlerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowErrorResponseHandlerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16808,7 +16808,7 @@ func TestFlattenMapWorkflowInternalProperties(t *testing.T) { func TestFlattenMapWorkflowPendingDynamicWorkflowInfoRelationship(t *testing.T) { p := models.WorkflowPendingDynamicWorkflowInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowPendingDynamicWorkflowInfoRelationship(p, d) @@ -16819,14 +16819,14 @@ func TestFlattenMapWorkflowPendingDynamicWorkflowInfoRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowPendingDynamicWorkflowInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowProperties(t *testing.T) { p := models.WorkflowProperties{} var d = &schema.ResourceData{} - c := `{"Timeout":32,"ClassId":"workflow.Properties","RetryDelay":32,"RetryCount":32,"RetryPolicy":"RetryPolicy %d","SupportStatus":"SupportStatus %d","ObjectType":"workflow.Properties","ExternalMeta":true,"TimeoutPolicy":"TimeoutPolicy %d"}` + c := `{"RetryDelay":32,"RetryPolicy":"RetryPolicy %d","TimeoutPolicy":"TimeoutPolicy %d","RetryCount":32,"ClassId":"workflow.Properties","ObjectType":"workflow.Properties","SupportStatus":"SupportStatus %d","Timeout":32,"ExternalMeta":true}` //test when the response is empty ffOpEmpty := flattenMapWorkflowProperties(p, d) @@ -16837,7 +16837,7 @@ func TestFlattenMapWorkflowProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowProperties(p, d)[0] - expectedOp := map[string]interface{}{"timeout": 32, "class_id": "workflow.Properties", "retry_delay": 32, "retry_count": 32, "retry_policy": "RetryPolicy 1", "support_status": "SupportStatus 1", "object_type": "workflow.Properties", "external_meta": true, "timeout_policy": "TimeoutPolicy 1"} + expectedOp := map[string]interface{}{"retry_delay": 32, "retry_policy": "RetryPolicy 1", "timeout_policy": "TimeoutPolicy 1", "retry_count": 32, "class_id": "workflow.Properties", "object_type": "workflow.Properties", "support_status": "SupportStatus 1", "timeout": 32, "external_meta": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16862,7 +16862,7 @@ func TestFlattenMapWorkflowTaskConstraints(t *testing.T) { func TestFlattenMapWorkflowTaskDefinitionRelationship(t *testing.T) { p := models.WorkflowTaskDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowTaskDefinitionRelationship(p, d) @@ -16873,14 +16873,14 @@ func TestFlattenMapWorkflowTaskDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowTaskDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowTaskInfoRelationship(t *testing.T) { p := models.WorkflowTaskInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowTaskInfoRelationship(p, d) @@ -16891,7 +16891,7 @@ func TestFlattenMapWorkflowTaskInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowTaskInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16916,7 +16916,7 @@ func TestFlattenMapWorkflowTaskMetadataRelationship(t *testing.T) { func TestFlattenMapWorkflowValidationInformation(t *testing.T) { p := models.WorkflowValidationInformation{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.ValidationInformation","ClassId":"workflow.ValidationInformation","State":"State %d"}` + c := `{"ClassId":"workflow.ValidationInformation","State":"State %d","ObjectType":"workflow.ValidationInformation"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowValidationInformation(p, d) @@ -16927,7 +16927,7 @@ func TestFlattenMapWorkflowValidationInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowValidationInformation(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "workflow.ValidationInformation", "class_id": "workflow.ValidationInformation", "state": "State 1"} + expectedOp := map[string]interface{}{"class_id": "workflow.ValidationInformation", "state": "State 1", "object_type": "workflow.ValidationInformation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16952,7 +16952,7 @@ func TestFlattenMapWorkflowWorkflowCtx(t *testing.T) { func TestFlattenMapWorkflowWorkflowDefinitionRelationship(t *testing.T) { p := models.WorkflowWorkflowDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowDefinitionRelationship(p, d) @@ -16963,14 +16963,14 @@ func TestFlattenMapWorkflowWorkflowDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowInfoRelationship(t *testing.T) { p := models.WorkflowWorkflowInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowInfoRelationship(p, d) @@ -16981,7 +16981,7 @@ func TestFlattenMapWorkflowWorkflowInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17006,7 +17006,7 @@ func TestFlattenMapWorkflowWorkflowInfoProperties(t *testing.T) { func TestFlattenMapWorkflowWorkflowMetadataRelationship(t *testing.T) { p := models.WorkflowWorkflowMetadataRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowMetadataRelationship(p, d) @@ -17017,14 +17017,14 @@ func TestFlattenMapWorkflowWorkflowMetadataRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowMetadataRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowProperties(t *testing.T) { p := models.WorkflowWorkflowProperties{} var d = &schema.ResourceData{} - c := `{"Cloneable":true,"EnableDebug":true,"ExternalMeta":true,"ClassId":"workflow.WorkflowProperties","ObjectType":"workflow.WorkflowProperties","Retryable":true,"SupportStatus":"SupportStatus %d"}` + c := `{"SupportStatus":"SupportStatus %d","ClassId":"workflow.WorkflowProperties","ObjectType":"workflow.WorkflowProperties","Cloneable":true,"EnableDebug":true,"ExternalMeta":true,"Retryable":true}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowProperties(p, d) @@ -17035,14 +17035,14 @@ func TestFlattenMapWorkflowWorkflowProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowProperties(p, d)[0] - expectedOp := map[string]interface{}{"cloneable": true, "enable_debug": true, "external_meta": true, "class_id": "workflow.WorkflowProperties", "object_type": "workflow.WorkflowProperties", "retryable": true, "support_status": "SupportStatus 1"} + expectedOp := map[string]interface{}{"support_status": "SupportStatus 1", "class_id": "workflow.WorkflowProperties", "object_type": "workflow.WorkflowProperties", "cloneable": true, "enable_debug": true, "external_meta": true, "retryable": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapX509Certificate(t *testing.T) { p := models.X509Certificate{} var d = &schema.ResourceData{} - c := `{"PemCertificate":"PemCertificate %d","SignatureAlgorithm":"SignatureAlgorithm %d","ObjectType":"x509.Certificate","Sha256Fingerprint":"Sha256Fingerprint %d","ClassId":"x509.Certificate"}` + c := `{"ObjectType":"x509.Certificate","Sha256Fingerprint":"Sha256Fingerprint %d","PemCertificate":"PemCertificate %d","SignatureAlgorithm":"SignatureAlgorithm %d","ClassId":"x509.Certificate"}` //test when the response is empty ffOpEmpty := flattenMapX509Certificate(p, d) @@ -17053,7 +17053,7 @@ func TestFlattenMapX509Certificate(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapX509Certificate(p, d)[0] - expectedOp := map[string]interface{}{"pem_certificate": "PemCertificate 1", "signature_algorithm": "SignatureAlgorithm 1", "object_type": "x509.Certificate", "sha256_fingerprint": "Sha256Fingerprint 1", "class_id": "x509.Certificate"} + expectedOp := map[string]interface{}{"object_type": "x509.Certificate", "sha256_fingerprint": "Sha256Fingerprint 1", "pem_certificate": "PemCertificate 1", "signature_algorithm": "SignatureAlgorithm 1", "class_id": "x509.Certificate"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } diff --git a/website/docs/r/asset_target.html.markdown b/website/docs/r/asset_target.html.markdown index f102e71799..def80fa93a 100644 --- a/website/docs/r/asset_target.html.markdown +++ b/website/docs/r/asset_target.html.markdown @@ -137,18 +137,6 @@ $ terraform import intersight_asset_target.example 1234567890987654321abcde ``` ## Allowed Types in `AdditionalProperties` -### [asset.OrchestrationService](#argument-reference) -OrchestrationService provides the necessary configuration details to enable Intersight Orchestration on the selected managed target. Subject to licensing. - -### [asset.TerraformIntegrationService](#argument-reference) -TerraformIntegrationService provides the necessary configuration details to enable Intersight Cloud Region on the selected Terraform Cloud. - -### [asset.VirtualizationService](#argument-reference) -The necessary configuration details to enable Intersight Virtualization features on the selected managed target. - -### [asset.WorkloadOptimizerService](#argument-reference) -WorkloadOptimizerService provides the necessary configuration details to enable Intersight Workflow Optimizer on the selected managed target. Subject to licensing. - ### [asset.CloudConnection](#argument-reference) CloudConnection provides the necessary details for Intersight to connect to and authenticate with a target at a well-known service address. The service address is inferred based upon the target type. For example Amazon Web Services. @@ -161,4 +149,16 @@ HttpConnection provides the necessary details for Intersight to connect to and a ### [asset.IntersightDeviceConnectorConnection](#argument-reference) Target is connected to Intersight using a Device Connector. + +### [asset.OrchestrationService](#argument-reference) +OrchestrationService provides the necessary configuration details to enable Intersight Orchestration on the selected managed target. Subject to licensing. + +### [asset.TerraformIntegrationService](#argument-reference) +TerraformIntegrationService provides the necessary configuration details to enable Intersight Cloud Region on the selected Terraform Cloud. + +### [asset.VirtualizationService](#argument-reference) +The necessary configuration details to enable Intersight Virtualization features on the selected managed target. + +### [asset.WorkloadOptimizerService](#argument-reference) +WorkloadOptimizerService provides the necessary configuration details to enable Intersight Workflow Optimizer on the selected managed target. Subject to licensing. \ No newline at end of file diff --git a/website/docs/r/firmware_bios_descriptor.html.markdown b/website/docs/r/firmware_bios_descriptor.html.markdown index e958f72bc2..8f99f538ee 100644 --- a/website/docs/r/firmware_bios_descriptor.html.markdown +++ b/website/docs/r/firmware_bios_descriptor.html.markdown @@ -15,7 +15,7 @@ Descriptor to uniquely identify a BIOS. resource "intersight_firmware_bios_descriptor" "firmware_bios_descriptor1" { description = "firmware bios descriptor" model = "N20-B6620-1" - version = "S5500.86B.01.00.0036-191.061320091126" + version = "S5500.86B.01.00.0036-191.0.1420091126" vendor = "Cisco Systems Inc" revision = "0" }