@@ -55,8 +55,8 @@ func TestInstallController_PatchAppConfigValues(t *testing.T) {
55
55
expectedState : StateApplicationConfigured ,
56
56
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
57
57
mock .InOrder (
58
- am .On ("ValidateConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
59
- am .On ("PatchConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
58
+ am .On ("ValidateConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
59
+ am .On ("PatchConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
60
60
)
61
61
},
62
62
expectedErr : false ,
@@ -70,8 +70,8 @@ func TestInstallController_PatchAppConfigValues(t *testing.T) {
70
70
expectedState : StateApplicationConfigured ,
71
71
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
72
72
mock .InOrder (
73
- am .On ("ValidateConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
74
- am .On ("PatchConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
73
+ am .On ("ValidateConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
74
+ am .On ("PatchConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
75
75
)
76
76
},
77
77
expectedErr : false ,
@@ -85,8 +85,8 @@ func TestInstallController_PatchAppConfigValues(t *testing.T) {
85
85
expectedState : StateApplicationConfigured ,
86
86
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
87
87
mock .InOrder (
88
- am .On ("ValidateConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
89
- am .On ("PatchConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
88
+ am .On ("ValidateConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
89
+ am .On ("PatchConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
90
90
)
91
91
},
92
92
expectedErr : false ,
@@ -100,7 +100,7 @@ func TestInstallController_PatchAppConfigValues(t *testing.T) {
100
100
expectedState : StateApplicationConfigurationFailed ,
101
101
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
102
102
mock .InOrder (
103
- am .On ("ValidateConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "invalid-value" }}).Return (errors .New ("validation error" )),
103
+ am .On ("ValidateConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "invalid-value" }}).Return (errors .New ("validation error" )),
104
104
)
105
105
},
106
106
expectedErr : true ,
@@ -114,8 +114,8 @@ func TestInstallController_PatchAppConfigValues(t *testing.T) {
114
114
expectedState : StateApplicationConfigurationFailed ,
115
115
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
116
116
mock .InOrder (
117
- am .On ("ValidateConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
118
- am .On ("PatchConfigValues" , appConfig , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (errors .New ("set config error" )),
117
+ am .On ("ValidateConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (nil ),
118
+ am .On ("PatchConfigValues" , types.AppConfigValues {"test-item" : types.AppConfigValue {Value : "new-value" }}).Return (errors .New ("set config error" )),
119
119
)
120
120
},
121
121
expectedErr : true ,
@@ -206,8 +206,7 @@ func TestInstallController_GetAppConfigValues(t *testing.T) {
206
206
"test-item" : types.AppConfigValue {Value : "value" },
207
207
"another-item" : types.AppConfigValue {Value : "another-value" },
208
208
}
209
- am .On ("GetConfig" ).Return (appConfig , nil )
210
- am .On ("GetConfigValues" , appConfig , false ).Return (expectedValues , nil )
209
+ am .On ("GetConfigValues" , false ).Return (expectedValues , nil )
211
210
},
212
211
expectedValues : types.AppConfigValues {
213
212
"test-item" : types.AppConfigValue {Value : "value" },
@@ -218,17 +217,15 @@ func TestInstallController_GetAppConfigValues(t *testing.T) {
218
217
{
219
218
name : "get config values error" ,
220
219
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
221
- am .On ("GetConfig" ).Return (appConfig , nil )
222
- am .On ("GetConfigValues" , appConfig , false ).Return (nil , errors .New ("get config values error" ))
220
+ am .On ("GetConfigValues" , false ).Return (nil , errors .New ("get config values error" ))
223
221
},
224
222
expectedValues : nil ,
225
223
expectedErr : true ,
226
224
},
227
225
{
228
226
name : "empty config values" ,
229
227
setupMocks : func (am * appconfig.MockAppConfigManager , st * store.MockStore ) {
230
- am .On ("GetConfig" ).Return (appConfig , nil )
231
- am .On ("GetConfigValues" , appConfig , false ).Return (types.AppConfigValues {}, nil )
228
+ am .On ("GetConfigValues" , false ).Return (types.AppConfigValues {}, nil )
232
229
},
233
230
expectedValues : types.AppConfigValues {},
234
231
expectedErr : false ,
0 commit comments