Skip to content

Commit 8eb9743

Browse files
committed
Updated search attribute data source tests
1 parent 6c38cea commit 8eb9743

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

internal/provider/search_attribute_data_source_test.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)