-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprovider_test.go
57 lines (52 loc) · 1.74 KB
/
provider_test.go
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
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"os"
"testing"
)
var (
testAccProvider *schema.Provider
testAccProviders map[string]terraform.ResourceProvider
testAccCheckIdentitynowConfig string
)
func init() {
testAccProvider = Provider().(*schema.Provider)
testAccProviders = map[string]terraform.ResourceProvider{
"identitynow": testAccProvider,
}
}
func TestProvider(t *testing.T) {
if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
t.Fatalf("Error: %s", err)
}
}
func TestProvider_impl(t *testing.T) {
var _ terraform.ResourceProvider = Provider()
}
func testAccPreCheck(t *testing.T) {
if v := os.Getenv("IDENTITYNOW_URL"); v == "" {
t.Fatal("IDENTITYNOW_URL must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_CLIENT_ID"); v == "" {
t.Fatal("IDENTITYNOW_CLIENT_ID must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_CLIENT_SECRET"); v == "" {
t.Fatal("IDENTITYNOW_CLIENT_SECRET must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_EXTERNAL_OWNER_ID"); v == "" {
t.Fatal("IDENTITYNOW_EXTERNAL_OWNER_ID must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_OWNER_ID"); v == "" {
t.Fatal("IDENTITYNOW_OWNER_ID must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_OWNER_NAME"); v == "" {
t.Fatal("IDENTITYNOW_OWNER_NAME must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_CLUSTER_ID"); v == "" {
t.Fatal("IDENTITYNOW_CLUSTER_ID must be set for acceptance tests")
}
if v := os.Getenv("IDENTITYNOW_CLUSTER_NAME"); v == "" {
t.Fatal("IDENTITYNOW_CLUSTER_NAME must be set for acceptance tests")
}
}