@@ -11,24 +11,20 @@ func TestAccSearchAttributeDataSource(t *testing.T) {
1111 ProtoV6ProviderFactories : testAccProtoV6ProviderFactories ,
1212
1313 Steps : []resource.TestStep {
14+ // Test reading from the server and setting data source attributes
1415 {
15- Config : testAccSearchAttributeDataSourceConfig ("default" , "RunId" ),
16+ Config : providerConfig + `
17+ data "temporal_search_attribute" "example" {
18+ name = "RunId"
19+ namespace = "default"
20+ }` ,
21+
1622 Check : resource .ComposeAggregateTestCheckFunc (
1723 resource .TestCheckResourceAttr ("data.temporal_search_attribute.example" , "name" , "RunId" ),
18- resource .TestCheckResourceAttr ("data.temporal_search_attribute.example" , "type" , "Keyword" ),
24+ resource .TestCheckResourceAttr ("data.temporal_search_attribute.example" , "type" , "Keyword" ), // Verify that the type was read correctly from the server
1925 resource .TestCheckResourceAttr ("data.temporal_search_attribute.example" , "namespace" , "default" ),
2026 ),
2127 },
2228 },
2329 })
2430}
25-
26- // Helper function to create Terraform configuration string
27- func testAccSearchAttributeDataSourceConfig (namespace , attributeName string ) string {
28- return providerConfig + `
29- data "temporal_search_attribute" "example" {
30- name = "` + attributeName + `"
31- namespace = "` + namespace + `"
32- }
33- `
34- }
0 commit comments