@@ -769,5 +769,60 @@ func TestAccPortEntityUpdateBlueprintIdentifier(t *testing.T) {
769
769
},
770
770
},
771
771
})
772
+ }
772
773
774
+ func TestAccPortEntityWithDefaultArrayProp (t * testing.T ) {
775
+ identifier := utils .GenID ()
776
+ entityIdentifier := utils .GenID ()
777
+ var testAccActionConfigCreate = fmt .Sprintf (`
778
+ resource "port_blueprint" "microservice" {
779
+ title = "TF Provider Test BP0"
780
+ icon = "Terraform"
781
+ identifier = "%s"
782
+ properties = {
783
+ "array_props" = {
784
+ "myArrayIdentifier" = {
785
+ "title" = "My Array Identifier"
786
+ }
787
+ }
788
+ }
789
+ }
790
+ resource "port_entity" "microservice" {
791
+ title = "TF Provider Test Entity0"
792
+ blueprint = port_blueprint.microservice.identifier
793
+ identifier = "%s"
794
+ properties = {
795
+ array_props = {
796
+ string_items = {
797
+ "myArrayIdentifier" = ["My Array Value", "My Array Value2"]
798
+ }
799
+ }
800
+ }
801
+ }` , identifier , entityIdentifier )
802
+
803
+ resource .Test (t , resource.TestCase {
804
+ PreCheck : func () { acctest .TestAccPreCheck (t ) },
805
+ ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
806
+
807
+ Steps : []resource.TestStep {
808
+ {
809
+ Config : acctest .ProviderConfig + testAccActionConfigCreate ,
810
+ Check : resource .ComposeTestCheckFunc (
811
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "title" , "TF Provider Test Entity0" ),
812
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "blueprint" , identifier ),
813
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.array_props.string_items.myArrayIdentifier.0" , "My Array Value" ),
814
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.array_props.string_items.myArrayIdentifier.1" , "My Array Value2" ),
815
+ ),
816
+ },
817
+ {
818
+ Config : acctest .ProviderConfig + testAccActionConfigCreate ,
819
+ Check : resource .ComposeTestCheckFunc (
820
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "title" , "TF Provider Test Entity0" ),
821
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "blueprint" , identifier ),
822
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.array_props.string_items.myArrayIdentifier.0" , "My Array Value" ),
823
+ resource .TestCheckResourceAttr ("port_entity.microservice" , "properties.array_props.string_items.myArrayIdentifier.1" , "My Array Value2" ),
824
+ ),
825
+ },
826
+ },
827
+ })
773
828
}
0 commit comments