1- // Copyright (c) 2017, 2023 , Oracle and/or its affiliates. All rights reserved.
1+ // Copyright (c) 2017, 2021 , Oracle and/or its affiliates. All rights reserved.
22// Licensed under the Mozilla Public License v2.0
33
44package integrationtest
@@ -50,18 +50,18 @@ var (
5050 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
5151 "data_source_details" : acctest.RepresentationGroup {RepType : acctest .Required , Group : dataAssetDataSourceDetailsObjRepresentation },
5252 "project_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_ai_anomaly_detection_project.test_project.id}` },
53- "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
54- "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
55- "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
56- "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
57- "lifecycle" : acctest.RepresentationGroup {RepType : acctest .Required , Group : ignoreDefinedTagsChangesRep },
53+ // "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
54+ "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
55+ "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
56+ "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
57+ "lifecycle" : acctest.RepresentationGroup {RepType : acctest .Required , Group : ignoreDataAssetResultsChangesRep },
5858 }
5959
6060 aiAnomalyDetectionDataAssetAtpRepresentation = map [string ]interface {}{
6161 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
6262 "data_source_details" : acctest.RepresentationGroup {RepType : acctest .Required , Group : dataAssetDataSourceDetailsAtpRepresentation },
6363 "project_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_ai_anomaly_detection_project.test_project.id}` },
64- "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
64+ // "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
6565 "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
6666 "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
6767 "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
7272 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
7373 "data_source_details" : acctest.RepresentationGroup {RepType : acctest .Required , Group : dataAssetDataSourceDetailsInfluxRepresentation },
7474 "project_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_ai_anomaly_detection_project.test_project.id}` },
75- "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
75+ // "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
7676 "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
7777 "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
7878 "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
8181
8282 dataAssetDataSourceDetailsObjRepresentation = map [string ]interface {}{
8383 "data_source_type" : acctest.Representation {RepType : acctest .Required , Create : `ORACLE_OBJECT_STORAGE` },
84- "bucket" : acctest.Representation {RepType : acctest .Required , Create : `bucket- test` },
85- "namespace" : acctest.Representation {RepType : acctest .Required , Create : `dxterraformtest ` },
84+ "bucket" : acctest.Representation {RepType : acctest .Required , Create : `mset-idp- test-datasets ` },
85+ "namespace" : acctest.Representation {RepType : acctest .Required , Create : `id5zda5six9a ` },
8686 "object" : acctest.Representation {RepType : acctest .Required , Create : `latest_training_data.json` },
8787 }
8888
@@ -116,12 +116,16 @@ var (
116116 "organization_name" : acctest.Representation {RepType : acctest .Optional , Create : `organizationName` },
117117 "retention_policy_name" : acctest.Representation {RepType : acctest .Optional , Create : `${oci_identity_policy.test_policy.name}` },
118118 }
119+
120+ ignoreDataAssetResultsChangesRep = map [string ]interface {}{
121+ "ignore_changes" : acctest.Representation {RepType : acctest .Required , Create : []string {`defined_tags` , `system_tags` }},
122+ }
119123 //Change this to only what is required
120- AiAnomalyDetectionDataAssetResourceDependencies = acctest .GenerateResourceFromRepresentationMap ("oci_ai_anomaly_detection_project" , "test_project" , acctest .Required , acctest .Create , aiAnomalyDetectionProjectRepresentation ) +
121- acctest .GenerateResourceFromRepresentationMap ("oci_core_subnet" , "test_subnet" , acctest .Optional , acctest .Create , CoreSubnetRepresentation ) +
122- acctest .GenerateResourceFromRepresentationMap ("oci_core_vcn" , "test_vcn" , acctest .Optional , acctest .Create , CoreVcnRepresentation ) +
123- AvailabilityDomainConfig +
124- DefinedTagsDependencies
124+ AiAnomalyDetectionDataAssetResourceDependencies = acctest .GenerateResourceFromRepresentationMap ("oci_ai_anomaly_detection_project" , "test_project" , acctest .Required , acctest .Create , aiAnomalyDetectionProjectRepresentation )
125+ // acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Optional, acctest.Create, CoreSubnetRepresentation) +
126+ // acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Optional, acctest.Create, CoreVcnRepresentation)
127+ //+ AvailabilityDomainConfig
128+ //+ DefinedTagsDependencies
125129)
126130
127131func TestAiAnomalyDetectionDataAssetResource_basic (t * testing.T ) {
@@ -156,8 +160,8 @@ func TestAiAnomalyDetectionDataAssetResource_basic(t *testing.T) {
156160 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
157161 resource .TestCheckResourceAttr (resourceName , "data_source_details.#" , "1" ),
158162 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.data_source_type" , "ORACLE_OBJECT_STORAGE" ),
159- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "bucket- test" ),
160- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "dxterraformtest " ),
163+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "mset-idp- test-datasets " ),
164+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "id5zda5six9a " ),
161165 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.object" , "latest_training_data.json" ),
162166 resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
163167
@@ -179,9 +183,9 @@ func TestAiAnomalyDetectionDataAssetResource_basic(t *testing.T) {
179183 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
180184 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
181185 resource .TestCheckResourceAttr (resourceName , "data_source_details.#" , "1" ),
182- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "bucket- test" ),
186+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "mset-idp- test-datasets " ),
183187 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.data_source_type" , "ORACLE_OBJECT_STORAGE" ),
184- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "dxterraformtest " ),
188+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "id5zda5six9a " ),
185189 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.object" , "latest_training_data.json" ),
186190 resource .TestCheckResourceAttr (resourceName , "description" , "description" ),
187191 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
@@ -213,9 +217,9 @@ func TestAiAnomalyDetectionDataAssetResource_basic(t *testing.T) {
213217 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
214218 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentIdU ),
215219 resource .TestCheckResourceAttr (resourceName , "data_source_details.#" , "1" ),
216- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "bucket- test" ),
220+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "mset-idp- test-datasets " ),
217221 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.data_source_type" , "ORACLE_OBJECT_STORAGE" ),
218- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "dxterraformtest " ),
222+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "id5zda5six9a " ),
219223 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.object" , "latest_training_data.json" ),
220224 resource .TestCheckResourceAttr (resourceName , "description" , "description" ),
221225 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
@@ -242,9 +246,9 @@ func TestAiAnomalyDetectionDataAssetResource_basic(t *testing.T) {
242246 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
243247 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
244248 resource .TestCheckResourceAttr (resourceName , "data_source_details.#" , "1" ),
245- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "bucket- test" ),
249+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.bucket" , "mset-idp- test-datasets " ),
246250 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.data_source_type" , "ORACLE_OBJECT_STORAGE" ),
247- resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "dxterraformtest " ),
251+ resource .TestCheckResourceAttr (resourceName , "data_source_details.0.namespace" , "id5zda5six9a " ),
248252 resource .TestCheckResourceAttr (resourceName , "data_source_details.0.object" , "latest_training_data.json" ),
249253 resource .TestCheckResourceAttr (resourceName , "description" , "description2" ),
250254 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName2" ),
0 commit comments