@@ -27,26 +27,26 @@ func Test_Acc_Appdata_Dsource(t *testing.T) {
2727 CheckDestroy : testDsourceDestroy ,
2828 Steps : []resource.TestStep {
2929 {
30- Config : testDsourceBasic (sourceId , groupId , false , name , environmentUser , stagingEnvironment , "" , "dlpx" , "acc-test" ),
30+ Config : testDsourceBasic (sourceId , groupId , false , false , name , environmentUser , stagingEnvironment , "" , "dlpx" , "acc-test" ),
3131 ExpectError : regexp .MustCompile (`.*` ),
3232 },
3333 {
34- Config : testDsourceBasic (sourceId , groupId , false , name , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
34+ Config : testDsourceBasic (sourceId , groupId , false , false , name , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
3535 Check : resource .ComposeTestCheckFunc (
3636 testDsourceExists ("delphix_appdata_dsource.new_data_dsource" , sourceId ),
3737 resource .TestCheckResourceAttr ("delphix_appdata_dsource.new_data_dsource" , "source_id" , sourceId )),
3838 },
3939 {
4040 // positive update test case
41- Config : testDsourceBasic (sourceId , groupId , false , "update_name" , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
41+ Config : testDsourceBasic (sourceId , groupId , false , false , "update_name" , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
4242 Check : resource .ComposeTestCheckFunc (
4343 testDsourceExists ("delphix_appdata_dsource.new_data_dsource" , sourceId ),
4444 resource .TestCheckResourceAttr ("delphix_appdata_dsource.new_data_dsource" , "name" , "update_name" ),
4545 resource .TestCheckResourceAttr ("delphix_appdata_dsource.new_data_dsource" , "source_id" , sourceId )),
4646 },
4747 {
4848 // updating a tag and expecting no plan changes
49- Config : testDsourceBasic (sourceId , groupId , false , "update_name" , environmentUser , stagingEnvironment , parameters , "key1" , "value1" ),
49+ Config : testDsourceBasic (sourceId , groupId , false , false , "update_name" , environmentUser , stagingEnvironment , parameters , "key1" , "value1" ),
5050 Check : resource .ComposeTestCheckFunc (
5151 testDsourceExists ("delphix_appdata_dsource.new_data_dsource" , sourceId ),
5252 resource .TestCheckResourceAttr ("delphix_appdata_dsource.new_data_dsource" , "source_id" , sourceId ),
@@ -56,7 +56,7 @@ func Test_Acc_Appdata_Dsource(t *testing.T) {
5656 },
5757 {
5858 // updating a tag and expecting plan changes
59- Config : testDsourceBasic (sourceId , groupId , true , "update_name" , environmentUser , stagingEnvironment , parameters , "key-upd" , "value-upd" ),
59+ Config : testDsourceBasic (sourceId , groupId , false , true , "update_name" , environmentUser , stagingEnvironment , parameters , "key-upd" , "value-upd" ),
6060 Check : resource .ComposeTestCheckFunc (
6161 testDsourceExists ("delphix_appdata_dsource.new_data_dsource" , sourceId ),
6262 resource .TestCheckResourceAttr ("delphix_appdata_dsource.new_data_dsource" , "source_id" , sourceId ),
@@ -68,8 +68,8 @@ func Test_Acc_Appdata_Dsource(t *testing.T) {
6868 // },
6969 },
7070 {
71- // negative update test case
72- Config : testDsourceBasic (" sourceId" , groupId , false , name , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
71+ // negative update test case, we are updating make_account_owner to true
72+ Config : testDsourceBasic (sourceId , groupId , true , false , name , environmentUser , stagingEnvironment , parameters , "dlpx" , "acc-test" ),
7373 ExpectError : regexp .MustCompile (`.*` ),
7474 },
7575 },
@@ -111,13 +111,13 @@ func testDsourcePreCheck(t *testing.T, sourceId string, groupId string, name str
111111 }
112112}
113113
114- func testDsourceBasic (sourceId string , groupId string , ignore_tag_changes bool , name string , environmentUser string , stagingEnvironment string , parameters string , key string , value string ) string {
114+ func testDsourceBasic (sourceId string , groupId string , make_current_account_owner bool , ignore_tag_changes bool , name string , environmentUser string , stagingEnvironment string , parameters string , key string , value string ) string {
115115 return fmt .Sprintf (`
116116resource "delphix_appdata_dsource" "new_data_dsource" {
117117 source_value = "%s"
118118 group_id = "%s"
119119 log_sync_enabled = false
120- make_current_account_owner = true
120+ make_current_account_owner = "%v"
121121 link_type = "AppDataStaged"
122122 ignore_tag_changes = %v
123123 name = "%s"
@@ -157,7 +157,7 @@ resource "delphix_appdata_dsource" "new_data_dsource" {
157157 }
158158 }
159159}
160- ` , sourceId , groupId , ignore_tag_changes , name , environmentUser , stagingEnvironment , parameters , key , value )
160+ ` , sourceId , groupId , make_current_account_owner , ignore_tag_changes , name , environmentUser , stagingEnvironment , parameters , key , value )
161161}
162162
163163func testDsourceExists (n string , sourceId string ) resource.TestCheckFunc {
0 commit comments