@@ -499,3 +499,99 @@ func TestAccPortEntityUpdateIdentifier(t *testing.T) {
499
499
})
500
500
501
501
}
502
+
503
+ func TestAccPortEntityUpdateBlueprintIdentifier (t * testing.T ) {
504
+
505
+ blueprintIdentifier := utils .GenID ()
506
+ blueprintIdentifier2 := utils .GenID ()
507
+ entityIdentifier := utils .GenID ()
508
+
509
+ var testAccActionConfigCreate = fmt .Sprintf (`
510
+ resource "port_blueprint" "microservice" {
511
+ title = "TF Provider Test BP0"
512
+ icon = "Terraform"
513
+ identifier = "%s"
514
+ properties = {
515
+ "string_props" = {
516
+ "myStringIdentifier" = {
517
+ "title" = "My String Identifier"
518
+ }
519
+ }
520
+ }
521
+ }
522
+ resource "port_entity" "microservice" {
523
+ title = "TF Provider Test Entity0"
524
+ blueprint = port_blueprint.microservice.identifier
525
+ identifier = "%s"
526
+ properties = {
527
+ "string_props" = {
528
+ "myStringIdentifier" = "My String Value"
529
+ }
530
+ }
531
+ }` , blueprintIdentifier , entityIdentifier )
532
+
533
+ var testAccActionConfigUpdate = fmt .Sprintf (`
534
+ resource "port_blueprint" "microservice" {
535
+ title = "TF Provider Test BP0"
536
+ icon = "Terraform"
537
+ identifier = "%s"
538
+ properties = {
539
+ "string_props" = {
540
+ "myStringIdentifier" = {
541
+ "title" = "My String Identifier"
542
+ }
543
+ }
544
+ }
545
+ }
546
+
547
+ resource "port_blueprint" "microservice2" {
548
+ title = "TF Provider Test BP0"
549
+ icon = "Terraform"
550
+ identifier = "%s"
551
+ properties = {
552
+ "string_props" = {
553
+ "myStringIdentifier" = {
554
+ "title" = "My String Identifier"
555
+ }
556
+ }
557
+ }
558
+ }
559
+
560
+ resource "port_entity" "microservice" {
561
+ title = "TF Provider Test Entity0"
562
+ blueprint = port_blueprint.microservice2.identifier
563
+ identifier = "%s"
564
+ properties = {
565
+ "string_props" = {
566
+ "myStringIdentifier" = "My String Value2"
567
+ }
568
+ }
569
+ }` , blueprintIdentifier , blueprintIdentifier2 , entityIdentifier )
570
+
571
+ resource .Test (t , resource.TestCase {
572
+ PreCheck : func () { acctest .TestAccPreCheck (t ) },
573
+ ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
574
+
575
+ Steps : []resource.TestStep {
576
+ {
577
+ Config : acctest .ProviderConfig + testAccActionConfigCreate ,
578
+ Check : resource .ComposeTestCheckFunc (
579
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "identifier" , entityIdentifier ),
580
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "title" , "TF Provider Test Entity0" ),
581
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "blueprint" , blueprintIdentifier ),
582
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.string_props.myStringIdentifier" , "My String Value" ),
583
+ ),
584
+ },
585
+ {
586
+ Config : acctest .ProviderConfig + testAccActionConfigUpdate ,
587
+ Check : resource .ComposeTestCheckFunc (
588
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "identifier" , entityIdentifier ),
589
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "title" , "TF Provider Test Entity0" ),
590
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "blueprint" , blueprintIdentifier2 ),
591
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.string_props.myStringIdentifier" , "My String Value2" ),
592
+ ),
593
+ },
594
+ },
595
+ })
596
+
597
+ }
0 commit comments