@@ -113,11 +113,11 @@ func TestBrickCreate(t *testing.T) {
113113
114114func TestGetBrickInstanceVariableDetails (t * testing.T ) {
115115 tests := []struct {
116- name string
117- brick * bricksindex.Brick
118- userVariables map [string ]string
119- expectedInstanceVariable []BrickConfigVariable
120- expectedVariableMap map [string ]string
116+ name string
117+ brick * bricksindex.Brick
118+ userVariables map [string ]string
119+ expectedConfigVariables []BrickConfigVariable
120+ expectedVariableMap map [string ]string
121121 }{
122122 {
123123 name : "variable is present in the map" ,
@@ -127,7 +127,7 @@ func TestGetBrickInstanceVariableDetails(t *testing.T) {
127127 },
128128 },
129129 userVariables : map [string ]string {"VAR1" : "value1" },
130- expectedInstanceVariable : []BrickConfigVariable {
130+ expectedConfigVariables : []BrickConfigVariable {
131131 {Name : "VAR1" , Value : "value1" , Description : "desc" , Required : true },
132132 },
133133 expectedVariableMap : map [string ]string {"VAR1" : "value1" },
@@ -140,7 +140,7 @@ func TestGetBrickInstanceVariableDetails(t *testing.T) {
140140 },
141141 },
142142 userVariables : map [string ]string {},
143- expectedInstanceVariable : []BrickConfigVariable {
143+ expectedConfigVariables : []BrickConfigVariable {
144144 {Name : "VAR1" , Value : "" , Description : "desc" , Required : true },
145145 },
146146 expectedVariableMap : map [string ]string {"VAR1" : "" },
@@ -153,7 +153,7 @@ func TestGetBrickInstanceVariableDetails(t *testing.T) {
153153 },
154154 },
155155 userVariables : map [string ]string {},
156- expectedInstanceVariable : []BrickConfigVariable {
156+ expectedConfigVariables : []BrickConfigVariable {
157157 {Name : "VAR1" , Value : "default" , Description : "desc" , Required : false },
158158 },
159159 expectedVariableMap : map [string ]string {"VAR1" : "default" },
@@ -167,26 +167,26 @@ func TestGetBrickInstanceVariableDetails(t *testing.T) {
167167 },
168168 },
169169 userVariables : map [string ]string {"VAR1" : "v1" },
170- expectedInstanceVariable : []BrickConfigVariable {
170+ expectedConfigVariables : []BrickConfigVariable {
171171 {Name : "VAR1" , Value : "v1" , Description : "desc1" , Required : true },
172172 {Name : "VAR2" , Value : "def2" , Description : "desc2" , Required : false },
173173 },
174174 expectedVariableMap : map [string ]string {"VAR1" : "v1" , "VAR2" : "def2" },
175175 },
176176 {
177- name : "no variables" ,
178- brick : & bricksindex.Brick {Variables : []bricksindex.BrickVariable {}},
179- userVariables : map [string ]string {},
180- expectedInstanceVariable : []BrickConfigVariable {},
181- expectedVariableMap : map [string ]string {},
177+ name : "no variables" ,
178+ brick : & bricksindex.Brick {Variables : []bricksindex.BrickVariable {}},
179+ userVariables : map [string ]string {},
180+ expectedConfigVariables : []BrickConfigVariable {},
181+ expectedVariableMap : map [string ]string {},
182182 },
183183 }
184184
185185 for _ , tt := range tests {
186186 t .Run (tt .name , func (t * testing.T ) {
187- actualVariableMap , actualInstanceVariables := getBrickConfigDetails (tt .brick , tt .userVariables )
187+ actualVariableMap , actualConfigVariables := getBrickConfigDetails (tt .brick , tt .userVariables )
188188 require .Equal (t , tt .expectedVariableMap , actualVariableMap )
189- require .Equal (t , tt .expectedInstanceVariable , actualInstanceVariables )
189+ require .Equal (t , tt .expectedConfigVariables , actualConfigVariables )
190190 })
191191 }
192192}
0 commit comments