forked from DavidKrau/terraform-provider-simplemdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignmentGroup_data_source_test.go
More file actions
34 lines (29 loc) · 1.04 KB
/
assignmentGroup_data_source_test.go
File metadata and controls
34 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package provider
import (
"fmt"
"testing"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
func TestAccAssignmentGroupDataSource(t *testing.T) {
testAccPreCheck(t)
assignmentGroupID := testAccRequireEnv(t, "SIMPLEMDM_ASSIGNMENT_GROUP_ID")
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: providerConfig + fmt.Sprintf(`
data "simplemdm_assignmentgroup" "test" {
id = "%s"
}
`, assignmentGroupID),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("data.simplemdm_assignmentgroup.test", "id", assignmentGroupID),
// created_at and updated_at may be empty depending on API version
// Just verify the fields exist in schema
resource.TestCheckResourceAttrSet("data.simplemdm_assignmentgroup.test", "name"),
resource.TestCheckResourceAttrSet("data.simplemdm_assignmentgroup.test", "group_type"),
),
},
},
})
}