@@ -29,7 +29,7 @@ func TestListGroupVariabless(t *testing.T) {
29
29
mux .HandleFunc ("/api/v4/groups/1/variables" ,
30
30
func (w http.ResponseWriter , r * http.Request ) {
31
31
testMethod (t , r , http .MethodGet )
32
- fmt .Fprint (w , `[{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden ": true}]` )
32
+ fmt .Fprint (w , `[{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden ": true}]` )
33
33
})
34
34
35
35
variables , _ , err := client .GroupVariables .ListVariables (1 , & ListGroupVariablesOptions {})
@@ -39,11 +39,11 @@ func TestListGroupVariabless(t *testing.T) {
39
39
40
40
want := []* GroupVariable {
41
41
{
42
- Key : "TEST_VARIABLE_1" ,
43
- Value : "test1" ,
44
- Protected : false ,
45
- Masked : true ,
46
- Hidden : true ,
42
+ Key : "TEST_VARIABLE_1" ,
43
+ Value : "test1" ,
44
+ Protected : false ,
45
+ Masked : true ,
46
+ MaskedAndHidden : true ,
47
47
},
48
48
}
49
49
@@ -59,15 +59,15 @@ func TestGetGroupVariable(t *testing.T) {
59
59
func (w http.ResponseWriter , r * http.Request ) {
60
60
testMethod (t , r , http .MethodGet )
61
61
testParams (t , r , "filter%5Benvironment_scope%5D=prod" )
62
- fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden ": true}` )
62
+ fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden ": true}` )
63
63
})
64
64
65
65
variable , _ , err := client .GroupVariables .GetVariable (1 , "TEST_VARIABLE_1" , & GetGroupVariableOptions {Filter : & VariableFilter {EnvironmentScope : "prod" }})
66
66
if err != nil {
67
67
t .Errorf ("GroupVariables.GetVariable returned error: %v" , err )
68
68
}
69
69
70
- want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true , Hidden : true }
70
+ want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true , MaskedAndHidden : true }
71
71
if ! reflect .DeepEqual (want , variable ) {
72
72
t .Errorf ("GroupVariables.GetVariable returned %+v, want %+v" , variable , want )
73
73
}
@@ -79,23 +79,23 @@ func TestCreateGroupVariable(t *testing.T) {
79
79
mux .HandleFunc ("/api/v4/groups/1/variables" ,
80
80
func (w http.ResponseWriter , r * http.Request ) {
81
81
testMethod (t , r , http .MethodPost )
82
- fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden ": true}` )
82
+ fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"masked_and_hidden ": true}` )
83
83
})
84
84
85
85
opt := & CreateGroupVariableOptions {
86
- Key : Ptr ("TEST_VARIABLE_1" ),
87
- Value : Ptr ("test1" ),
88
- Protected : Ptr (false ),
89
- Masked : Ptr (true ),
90
- Hidden : Ptr (true ),
86
+ Key : Ptr ("TEST_VARIABLE_1" ),
87
+ Value : Ptr ("test1" ),
88
+ Protected : Ptr (false ),
89
+ Masked : Ptr (true ),
90
+ MaskedAndHidden : Ptr (true ),
91
91
}
92
92
93
93
variable , _ , err := client .GroupVariables .CreateVariable (1 , opt , nil )
94
94
if err != nil {
95
95
t .Errorf ("GroupVariables.CreateVariable returned error: %v" , err )
96
96
}
97
97
98
- want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true , Hidden : true }
98
+ want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true , MaskedAndHidden : true }
99
99
if ! reflect .DeepEqual (want , variable ) {
100
100
t .Errorf ("GroupVariables.CreateVariable returned %+v, want %+v" , variable , want )
101
101
}
@@ -128,15 +128,15 @@ func TestUpdateGroupVariable(t *testing.T) {
128
128
mux .HandleFunc ("/api/v4/groups/1/variables/TEST_VARIABLE_1" ,
129
129
func (w http.ResponseWriter , r * http.Request ) {
130
130
testMethod (t , r , http .MethodPut )
131
- fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true,"hidden": false }` )
131
+ fmt .Fprint (w , `{"key": "TEST_VARIABLE_1","value": "test1","protected": false,"masked": true}` )
132
132
})
133
133
134
134
variable , _ , err := client .GroupVariables .UpdateVariable (1 , "TEST_VARIABLE_1" , & UpdateGroupVariableOptions {})
135
135
if err != nil {
136
136
t .Errorf ("GroupVariables.UpdateVariable returned error: %v" , err )
137
137
}
138
138
139
- want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true , Hidden : false }
139
+ want := & GroupVariable {Key : "TEST_VARIABLE_1" , Value : "test1" , Protected : false , Masked : true }
140
140
if ! reflect .DeepEqual (want , variable ) {
141
141
t .Errorf ("Groups.UpdatedGroup returned %+v, want %+v" , variable , want )
142
142
}
0 commit comments