(Exchange exchange)
| 195 | } |
| 196 | |
| 197 | public void expandSettings(Exchange exchange) |
| 198 | { |
| 199 | Object exchangeId = exchange.id; |
| 200 | Object keysGlobal = Helpers.add(getRootDir(), "keys.json"); |
| 201 | Object keysLocal = Helpers.add(getRootDir(), "keys.local.json"); |
| 202 | Object keysGlobalExists = ioFileExists(keysGlobal); |
| 203 | Object keysLocalExists = ioFileExists(keysLocal); |
| 204 | Object globalSettings = new java.util.HashMap<String, Object>() {{}}; |
| 205 | if (Helpers.isTrue(keysGlobalExists)) |
| 206 | { |
| 207 | globalSettings = ioFileRead(keysGlobal); |
| 208 | } |
| 209 | Object localSettings = new java.util.HashMap<String, Object>() {{}}; |
| 210 | if (Helpers.isTrue(keysLocalExists)) |
| 211 | { |
| 212 | localSettings = ioFileRead(keysLocal); |
| 213 | } |
| 214 | Object allSettings = exchange.deepExtend(globalSettings, localSettings); |
| 215 | Object exchangeSettings = exchange.safeValue(allSettings, exchangeId, new java.util.HashMap<String, Object>() {{}}); |
| 216 | if (Helpers.isTrue(exchangeSettings)) |
| 217 | { |
| 218 | Object settingKeys = Helpers.objectKeys(exchangeSettings); |
| 219 | for (var i = 0; Helpers.isLessThan(i, Helpers.getArrayLength(settingKeys)); i++) |
| 220 | { |
| 221 | Object key = Helpers.GetValue(settingKeys, i); |
| 222 | if (Helpers.isTrue(Helpers.GetValue(exchangeSettings, key))) |
| 223 | { |
| 224 | Object finalValue = null; |
| 225 | if (Helpers.isTrue(exchange.isDictionary(Helpers.GetValue(exchangeSettings, key)))) |
| 226 | { |
| 227 | Object existing = getExchangeProp(exchange, key, new java.util.HashMap<String, Object>() {{}}); |
| 228 | finalValue = exchange.deepExtend(existing, Helpers.GetValue(exchangeSettings, key)); |
| 229 | } else |
| 230 | { |
| 231 | finalValue = Helpers.GetValue(exchangeSettings, key); |
| 232 | } |
| 233 | setExchangeProp(exchange, key, finalValue); |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | // credentials |
| 238 | if (Helpers.isTrue(this.loadKeys)) |
| 239 | { |
| 240 | this.loadCredentialsFromEnv(exchange); |
| 241 | } |
| 242 | // skipped tests |
| 243 | Object skippedFile = Helpers.add(getRootDir(), "skip-tests.json"); |
| 244 | Object skippedSettings = ioFileRead(skippedFile); |
| 245 | this.skippedSettingsForExchange = exchange.safeValue(skippedSettings, exchangeId, new java.util.HashMap<String, Object>() {{}}); |
| 246 | Object skippedSettingsForExchange = this.skippedSettingsForExchange; |
| 247 | // others |
| 248 | Object timeout = exchange.safeValue(skippedSettingsForExchange, "timeout"); |
| 249 | if (Helpers.isTrue(!Helpers.isEqual(timeout, null))) |
| 250 | { |
| 251 | exchange.timeout = exchange.parseToInt(timeout); |
| 252 | } |
| 253 | if (Helpers.isTrue(getCliArgValue("--useProxy"))) |
| 254 | { |
no test coverage detected