|
46 | 46 | "topic_id": Representation{repType: Required, create: `${oci_ons_notification_topic.test_notification_topic.id}`}, |
47 | 47 | "defined_tags": Representation{repType: 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")}`}, |
48 | 48 | "freeform_tags": Representation{repType: Optional, create: map[string]string{"Department": "Finance"}, update: map[string]string{"Department": "Accounting"}}, |
49 | | - "delivery_policy": Representation{repType: Optional, update: `{\"backoffRetryPolicy\":{\"initialDelayInFailureRetry\":60000,\"maxRetryDuration\":7000000,\"policyType\":\"EXPONENTIAL\"}, \"maxReceiveRatePerSecond\" : 0}`}, |
| 49 | + "delivery_policy": Representation{repType: Optional, update: `{\"backoffRetryPolicy\":{\"maxRetryDuration\":7000000,\"policyType\":\"EXPONENTIAL\"}}`}, |
50 | 50 | } |
51 | 51 |
|
52 | 52 | SubscriptionResourceDependencies = DefinedTagsDependencies + |
@@ -116,11 +116,6 @@ func TestOnsSubscriptionResource_basic(t *testing.T) { |
116 | 116 |
|
117 | 117 | func(s *terraform.State) (err error) { |
118 | 118 | resId, err = fromInstanceState(s, resourceName, "id") |
119 | | - if isEnableExportCompartment, _ := strconv.ParseBool(getEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { |
120 | | - if errExport := testExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { |
121 | | - return errExport |
122 | | - } |
123 | | - } |
124 | 119 | return err |
125 | 120 | }, |
126 | 121 | ), |
@@ -169,6 +164,11 @@ func TestOnsSubscriptionResource_basic(t *testing.T) { |
169 | 164 |
|
170 | 165 | func(s *terraform.State) (err error) { |
171 | 166 | resId2, err = fromInstanceState(s, resourceName, "id") |
| 167 | + if isEnableExportCompartment, _ := strconv.ParseBool(getEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { |
| 168 | + if errExport := testExportCompartmentWithResourceName(&resId2, &compartmentId, resourceName); errExport != nil { |
| 169 | + return errExport |
| 170 | + } |
| 171 | + } |
172 | 172 | if resId != resId2 { |
173 | 173 | return fmt.Errorf("Resource recreated when it was supposed to be updated.") |
174 | 174 | } |
@@ -219,6 +219,18 @@ func TestOnsSubscriptionResource_basic(t *testing.T) { |
219 | 219 | resource.TestCheckResourceAttr(singularDatasourceName, "state", "ACTIVE"), |
220 | 220 | ), |
221 | 221 | }, |
| 222 | + // remove singular datasource from previous step so that it doesn't conflict with import tests |
| 223 | + { |
| 224 | + Config: config + compartmentIdVariableStr + SubscriptionResourceConfig, |
| 225 | + }, |
| 226 | + // verify resource import |
| 227 | + { |
| 228 | + Config: config, |
| 229 | + ImportState: true, |
| 230 | + ImportStateVerify: true, |
| 231 | + ImportStateVerifyIgnore: []string{}, |
| 232 | + ResourceName: resourceName, |
| 233 | + }, |
222 | 234 | }, |
223 | 235 | }) |
224 | 236 | } |
|
0 commit comments