@@ -28,6 +28,7 @@ const (
28
28
networkResourceName = "redpanda_network.test"
29
29
clusterResourceName = "redpanda_cluster.test"
30
30
userResourceName = "redpanda_user.test"
31
+ topicResourceName = "redpanda_topic.test"
31
32
aclResourceName = "redpanda_acl.test"
32
33
)
33
34
@@ -604,6 +605,14 @@ func TestAccResourcesWithDataSources(t *testing.T) {
604
605
maps .Copy (origTestCaseVars , providerCfgIDSecretVars )
605
606
origTestCaseVars ["cluster_id" ] = config .StringVariable (os .Getenv ("CLUSTER_ID" ))
606
607
origTestCaseVars ["user_name" ] = config .StringVariable (name )
608
+ origTestCaseVars ["topic_name" ] = config .StringVariable (name )
609
+
610
+ updateTestCaseVars := make (map [string ]config.Variable )
611
+ maps .Copy (updateTestCaseVars , origTestCaseVars )
612
+ // Change 1, remove other
613
+ updateTestCaseVars ["topic_config" ] = config .MapVariable (map [string ]config.Variable {
614
+ "compression.type" : config .StringVariable ("gzip" ),
615
+ })
607
616
608
617
c , err := newClients (ctx , clientID , clientSecret , "ign" )
609
618
if err != nil {
@@ -618,6 +627,15 @@ func TestAccResourcesWithDataSources(t *testing.T) {
618
627
ProtoV6ProviderFactories : testAccProtoV6ProviderFactories ,
619
628
Check : resource .ComposeAggregateTestCheckFunc (
620
629
resource .TestCheckResourceAttr (userResourceName , "name" , name ),
630
+ resource .TestCheckResourceAttr (topicResourceName , "name" , name ),
631
+ ),
632
+ },
633
+ {
634
+ ConfigFile : config .StaticFile (dataSourcesTest ),
635
+ ConfigVariables : updateTestCaseVars ,
636
+ ProtoV6ProviderFactories : testAccProtoV6ProviderFactories ,
637
+ Check : resource .ComposeAggregateTestCheckFunc (
638
+ resource .TestCheckResourceAttr (topicResourceName , "configuration.compression.type" , "gzip" ),
621
639
),
622
640
},
623
641
{
0 commit comments