Commit 2a1096e
fix: appId dropped when creating PropertiesCompatibleFileConfigRepository for non-default appId
DefaultConfigFactory.createPropertiesCompatibleFileConfigRepository() received an appId
parameter but called ConfigService.getConfigFile(namespace, format) — the two-arg overload
that ignores appId and resolves against the default app.id from app.properties.
Fixes the bug by:
1. Adding ConfigService.getConfigFile(appId, namespace, format) that delegates to the
already-correct ConfigManager.getConfigFile(appId, namespace, format).
2. Updating DefaultConfigFactory to call the new three-arg overload so the caller-specified
appId is preserved.
Adds tests:
- DefaultConfigFactoryTest.testCreatePropertiesCompatibleFileConfigRepositoryForwardsCustomAppId:
verifies ConfigManager is invoked with the supplied appId, never the default.
- ConfigServiceTest.testGetConfigFileWithCustomAppId:
verifies the new ConfigService.getConfigFile(appId, ns, format) overload returns a
ConfigFile whose getAppId() equals the requested appId.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a9a6edc commit 2a1096e
3 files changed
Lines changed: 42 additions & 1 deletion
File tree
- apollo-client/src
- main/java/com/ctrip/framework/apollo
- spi
- test/java/com/ctrip/framework/apollo
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
106 | 134 | | |
107 | 135 | | |
108 | 136 | | |
| |||
0 commit comments