forked from DavidKrau/terraform-provider-simplemdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenrollment_data_source_test.go
More file actions
29 lines (24 loc) · 934 Bytes
/
enrollment_data_source_test.go
File metadata and controls
29 lines (24 loc) · 934 Bytes
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
package provider
import (
"fmt"
"testing"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
func TestAccEnrollmentDataSource(t *testing.T) {
testAccPreCheck(t)
enrollmentID := testAccRequireEnv(t, "SIMPLEMDM_ENROLLMENT_ID")
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: providerConfig + fmt.Sprintf(`data "simplemdm_enrollment" "test" { id = "%s" }`, enrollmentID),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("data.simplemdm_enrollment.test", "id", enrollmentID),
resource.TestCheckResourceAttrSet("data.simplemdm_enrollment.test", "user_enrollment"),
resource.TestCheckResourceAttrSet("data.simplemdm_enrollment.test", "welcome_screen"),
resource.TestCheckResourceAttrSet("data.simplemdm_enrollment.test", "authentication"),
),
},
},
})
}