@@ -97,57 +97,6 @@ func TestAccM2Application_disappears(t *testing.T) {
9797 })
9898}
9999
100- func TestAccM2Application_tags (t * testing.T ) {
101- ctx := acctest .Context (t )
102- if testing .Short () {
103- t .Skip ("skipping long-running test in short mode" )
104- }
105- rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
106- resourceName := "aws_m2_application.test"
107- var application m2.GetApplicationOutput
108-
109- resource .ParallelTest (t , resource.TestCase {
110- PreCheck : func () { acctest .PreCheck (ctx , t ) },
111- ErrorCheck : acctest .ErrorCheck (t , names .M2 ),
112- ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
113- CheckDestroy : resource .ComposeAggregateTestCheckFunc (
114- testAccCheckApplicationDestroy (ctx ),
115- ),
116- Steps : []resource.TestStep {
117- {
118- Config : testAccApplicationConfig_tags1 (rName , acctest .CtKey1 , acctest .CtValue1 ),
119- Check : resource .ComposeTestCheckFunc (
120- testAccCheckApplicationExists (ctx , resourceName , & application ),
121- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsPercent , acctest .Ct1 ),
122- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsKey1 , acctest .CtValue1 ),
123- ),
124- },
125- {
126- ResourceName : resourceName ,
127- ImportState : true ,
128- ImportStateVerify : true ,
129- },
130- {
131- Config : testAccApplicationConfig_tags2 (rName , acctest .CtKey1 , acctest .CtValue1Updated , acctest .CtKey2 , acctest .CtValue2 ),
132- Check : resource .ComposeTestCheckFunc (
133- testAccCheckApplicationExists (ctx , resourceName , & application ),
134- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsPercent , acctest .Ct2 ),
135- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsKey1 , acctest .CtValue1Updated ),
136- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsKey2 , acctest .CtValue2 ),
137- ),
138- },
139- {
140- Config : testAccApplicationConfig_tags1 (rName , acctest .CtKey2 , acctest .CtValue2 ),
141- Check : resource .ComposeTestCheckFunc (
142- testAccCheckApplicationExists (ctx , resourceName , & application ),
143- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsPercent , acctest .Ct1 ),
144- resource .TestCheckResourceAttr (resourceName , acctest .CtTagsKey2 , acctest .CtValue2 ),
145- ),
146- },
147- },
148- })
149- }
150-
151100func TestAccM2Application_full (t * testing.T ) {
152101 ctx := acctest .Context (t )
153102 if testing .Short () {
@@ -391,60 +340,3 @@ resource "aws_iam_role_policy" "test" {
391340}
392341` , rName )
393342}
394-
395- func testAccApplicationConfig_tags1 (rName , tagKey1 , tagValue1 string ) string {
396- return fmt .Sprintf (`
397- resource "aws_s3_bucket" "test" {
398- bucket = %[1]q
399- }
400-
401- resource "aws_s3_object" "test" {
402- bucket = aws_s3_bucket.test.id
403- key = "v1/PlanetsDemo-v1.zip"
404- source = "test-fixtures/PlanetsDemo-v1.zip"
405- }
406-
407- resource "aws_m2_application" "test" {
408- name = %[1]q
409- engine_type = "bluage"
410- definition {
411- content = templatefile("test-fixtures/application-definition.json", { s3_bucket = aws_s3_bucket.test.id, version = "v1" })
412- }
413-
414- tags = {
415- %[2]q = %[3]q
416- }
417-
418- depends_on = [aws_s3_object.test]
419- }
420- ` , rName , tagKey1 , tagValue1 )
421- }
422-
423- func testAccApplicationConfig_tags2 (rName , tagKey1 , tagValue1 , tagKey2 , tagValue2 string ) string {
424- return fmt .Sprintf (`
425- resource "aws_s3_bucket" "test" {
426- bucket = %[1]q
427- }
428-
429- resource "aws_s3_object" "test" {
430- bucket = aws_s3_bucket.test.id
431- key = "v1/PlanetsDemo-v1.zip"
432- source = "test-fixtures/PlanetsDemo-v1.zip"
433- }
434-
435- resource "aws_m2_application" "test" {
436- name = %[1]q
437- engine_type = "bluage"
438- definition {
439- content = templatefile("test-fixtures/application-definition.json", { s3_bucket = aws_s3_bucket.test.id, version = "v1" })
440- }
441-
442- tags = {
443- %[2]q = %[3]q
444- %[4]q = %[5]q
445- }
446-
447- depends_on = [aws_s3_object.test]
448- }
449- ` , rName , tagKey1 , tagValue1 , tagKey2 , tagValue2 )
450- }
0 commit comments