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