@@ -176,86 +176,3 @@ data "oci_core_drg_attachments" "test_drg_attachments" {
176176 })
177177}
178178
179- func TestCoreDrgAttachmentResource_forcenew (t * testing.T ) {
180- provider := testAccProvider
181- config := testProviderConfig ()
182-
183- compartmentId := getRequiredEnvSetting ("compartment_id_for_create" )
184- compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
185-
186- resourceName := "oci_core_drg_attachment.test_drg_attachment"
187-
188- var resId , resId2 string
189-
190- resource .Test (t , resource.TestCase {
191- Providers : map [string ]terraform.ResourceProvider {
192- "oci" : provider ,
193- },
194- Steps : []resource.TestStep {
195- // verify create with optionals
196- {
197- Config : config + DrgAttachmentPropertyVariables + compartmentIdVariableStr + DrgAttachmentResourceConfig ,
198- Check : resource .ComposeAggregateTestCheckFunc (
199- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
200- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
201- resource .TestCheckResourceAttrSet (resourceName , "drg_id" ),
202- resource .TestCheckResourceAttrSet (resourceName , "id" ),
203- resource .TestCheckResourceAttrSet (resourceName , "state" ),
204- resource .TestCheckResourceAttrSet (resourceName , "vcn_id" ),
205-
206- func (s * terraform.State ) (err error ) {
207- resId , err = fromInstanceState (s , resourceName , "id" )
208- return err
209- },
210- ),
211- },
212- // force new tests, test that changing a parameter would result in creation of a new resource.
213-
214- {
215- Config : config + `
216- variable "drg_attachment_display_name" { default = "displayName" }
217- ` + compartmentIdVariableStr + DrgAttachmentResourceConfig ,
218- Check : resource .ComposeAggregateTestCheckFunc (
219- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
220- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
221- resource .TestCheckResourceAttrSet (resourceName , "drg_id" ),
222- resource .TestCheckResourceAttrSet (resourceName , "id" ),
223- resource .TestCheckResourceAttrSet (resourceName , "state" ),
224- resource .TestCheckResourceAttrSet (resourceName , "vcn_id" ),
225-
226- func (s * terraform.State ) (err error ) {
227- resId2 , err = fromInstanceState (s , resourceName , "id" )
228- if resId == resId2 {
229- return fmt .Errorf ("Resource was expected to be recreated when updating parameter DrgId but the id did not change." )
230- }
231- resId = resId2
232- return err
233- },
234- ),
235- },
236-
237- {
238- Config : config + `
239- variable "drg_attachment_display_name" { default = "displayName" }
240- ` + compartmentIdVariableStr + DrgAttachmentResourceConfig ,
241- Check : resource .ComposeAggregateTestCheckFunc (
242- resource .TestCheckResourceAttrSet (resourceName , "compartment_id" ),
243- resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
244- resource .TestCheckResourceAttrSet (resourceName , "drg_id" ),
245- resource .TestCheckResourceAttrSet (resourceName , "id" ),
246- resource .TestCheckResourceAttrSet (resourceName , "state" ),
247- resource .TestCheckResourceAttrSet (resourceName , "vcn_id" ),
248-
249- func (s * terraform.State ) (err error ) {
250- resId2 , err = fromInstanceState (s , resourceName , "id" )
251- if resId == resId2 {
252- return fmt .Errorf ("Resource was expected to be recreated when updating parameter VcnId but the id did not change." )
253- }
254- resId = resId2
255- return err
256- },
257- ),
258- },
259- },
260- })
261- }
0 commit comments