-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathoidc_group_resource_test.go
More file actions
45 lines (42 loc) · 1.18 KB
/
oidc_group_resource_test.go
File metadata and controls
45 lines (42 loc) · 1.18 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
35
36
37
38
39
40
41
42
43
44
45
package provider
import (
"testing"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
func TestAccOidcGroupResource(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
// Create and Read testing.
{
Config: providerConfig + `
resource "dependencytrack_oidc_group" "test" {
name = "Test_Group"
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet("dependencytrack_oidc_group.test", "id"),
resource.TestCheckResourceAttr("dependencytrack_oidc_group.test", "name", "Test_Group"),
),
},
// ImportState testing.
{
ResourceName: "dependencytrack_oidc_group.test",
ImportState: true,
ImportStateVerify: true,
},
// Update and Read testing.
{
Config: providerConfig + `
resource "dependencytrack_oidc_group" "test" {
name = "Test_Group_2"
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet("dependencytrack_oidc_group.test", "id"),
resource.TestCheckResourceAttr("dependencytrack_oidc_group.test", "name", "Test_Group_2"),
),
},
},
})
}