@@ -15,13 +15,15 @@ func TestAccShippingMethod_createAndUpdateWithID(t *testing.T) {
15
15
key := "test-sh-method"
16
16
description := "test shipping method description"
17
17
localizedName := "some localized shipping method test name"
18
+ active := true
18
19
predicate := "1 = 1"
19
20
resourceName := "commercetools_shipping_method.standard"
20
21
21
22
newName := "new test sh method"
22
23
newKey := "new-test-sh-method"
23
24
newDescription := "new test shipping method description"
24
25
newLocalizedName := "some new localized shipping method test name"
26
+ newActive := false
25
27
newPredicate := "2 = 2"
26
28
27
29
resource .Test (t , resource.TestCase {
@@ -30,25 +32,27 @@ func TestAccShippingMethod_createAndUpdateWithID(t *testing.T) {
30
32
CheckDestroy : testAccCheckShippingMethodDestroy ,
31
33
Steps : []resource.TestStep {
32
34
{
33
- Config : testAccShippingMethodConfig (name , key , description , description , localizedName , false , true , predicate ),
35
+ Config : testAccShippingMethodConfig (name , key , description , description , localizedName , active , false , true , predicate ),
34
36
Check : resource .ComposeTestCheckFunc (
35
37
resource .TestCheckResourceAttr (resourceName , "name" , name ),
36
38
resource .TestCheckResourceAttr (resourceName , "key" , key ),
37
39
resource .TestCheckResourceAttr (resourceName , "description" , description ),
38
40
resource .TestCheckResourceAttr (resourceName , "localized_description.en" , description ),
39
41
resource .TestCheckResourceAttr (resourceName , "localized_name.en" , localizedName ),
42
+ resource .TestCheckResourceAttr (resourceName , "active" , "true" ),
40
43
resource .TestCheckResourceAttr (resourceName , "is_default" , "false" ),
41
44
resource .TestCheckResourceAttr (resourceName , "predicate" , predicate ),
42
45
),
43
46
},
44
47
{
45
- Config : testAccShippingMethodConfig (newName , newKey , newDescription , newDescription , newLocalizedName , true , true , newPredicate ),
48
+ Config : testAccShippingMethodConfig (newName , newKey , newDescription , newDescription , newLocalizedName , newActive , true , true , newPredicate ),
46
49
Check : resource .ComposeTestCheckFunc (
47
50
resource .TestCheckResourceAttr (resourceName , "name" , newName ),
48
51
resource .TestCheckResourceAttr (resourceName , "key" , newKey ),
49
52
resource .TestCheckResourceAttr (resourceName , "description" , newDescription ),
50
53
resource .TestCheckResourceAttr (resourceName , "localized_description.en" , newDescription ),
51
54
resource .TestCheckResourceAttr (resourceName , "localized_name.en" , newLocalizedName ),
55
+ resource .TestCheckResourceAttr (resourceName , "active" , "false" ),
52
56
resource .TestCheckResourceAttr (resourceName , "is_default" , "true" ),
53
57
resource .TestCheckResourceAttrSet (resourceName , "tax_category_id" ),
54
58
resource .TestCheckResourceAttr (resourceName , "predicate" , newPredicate ),
@@ -58,7 +62,7 @@ func TestAccShippingMethod_createAndUpdateWithID(t *testing.T) {
58
62
})
59
63
}
60
64
61
- func testAccShippingMethodConfig (name string , key string , description string , localizedDescription string , localizedName string , isDefault bool , setTaxCategory bool , predicate string ) string {
65
+ func testAccShippingMethodConfig (name string , key string , description string , localizedDescription string , localizedName string , active bool , isDefault bool , setTaxCategory bool , predicate string ) string {
62
66
taxCategoryReference := ""
63
67
if setTaxCategory {
64
68
taxCategoryReference = "tax_category_id = commercetools_tax_category.test.id"
@@ -80,6 +84,7 @@ func testAccShippingMethodConfig(name string, key string, description string, lo
80
84
localized_name = {
81
85
en = "{{ .localizedName }}"
82
86
}
87
+ active = "{{ .active }}"
83
88
is_default = "{{ .isDefault }}"
84
89
predicate = "{{ .predicate }}"
85
90
@@ -93,6 +98,7 @@ func testAccShippingMethodConfig(name string, key string, description string, lo
93
98
"localizedDescription" : localizedDescription ,
94
99
"localizedName" : localizedName ,
95
100
"isDefault" : isDefault ,
101
+ "active" : active ,
96
102
"predicate" : predicate ,
97
103
"taxCategoryReference" : taxCategoryReference ,
98
104
})
0 commit comments