-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_cf_app_test.go
47 lines (38 loc) · 1.05 KB
/
import_cf_app_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
package cloudfoundry
import (
"testing"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAccApp_importBasic(t *testing.T) {
_, orgName := defaultTestOrg(t)
_, spaceName := defaultTestSpace(t)
serviceName1, serviceName2, servicePlan := getTestServiceBrokers(t)
resourceName := "cloudfoundry_app.dummy-app"
resource.Test(t,
resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProvidersFactories,
CheckDestroy: testAccCheckAppDestroyed([]string{"dummy-app"}),
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(appResource,
defaultAppDomain(),
orgName, spaceName,
serviceName1, serviceName2, servicePlan, servicePlan, asset("dummy-app.zip")),
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"timeout",
"routes",
"path",
"strategy",
"service_binding",
},
},
},
})
}