-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_cf_service_plan_access_test.go
45 lines (36 loc) · 1.09 KB
/
import_cf_service_plan_access_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
package cloudfoundry
import (
"testing"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAccServicePlanAccess_importBasic(t *testing.T) {
serviceBrokerURL, serviceBrokerUser, serviceBrokerPassword, serviceBrokerPlanPath := getTestBrokerCredentials(t)
// Ensure any test artifacts from a
// failed run are deleted if the exist
deleteServiceBroker("test")
orgID, _ := defaultTestOrg(t)
resourceName := "cloudfoundry_service_plan_access.test-access"
var servicePlanAccessGUID string
resource.Test(t,
resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProvidersFactories,
CheckDestroy: testAccCheckServicePlanAccessDestroyed(servicePlanAccessGUID),
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(saResource,
serviceBrokerURL,
serviceBrokerUser,
serviceBrokerPassword,
serviceBrokerPlanPath,
orgID),
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}