Skip to content

Commit 7c83b3f

Browse files
committed
rename test systems files
1 parent ceb7d7e commit 7c83b3f

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

jmx-scraper/src/test/java/io/opentelemetry/contrib/jmxscraper/config/JmxScraperConfigTest.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,53 +160,56 @@ void shouldFailValidation_invalidTargetSystem(JmxScraperConfig.TargetSystemSourc
160160
@ValueSource(strings = {"auto", ""})
161161
void targetSystemSource_auto(String source) {
162162
Properties properties = (Properties) validProperties.clone();
163-
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system1");
163+
// we just need to provide a valid value for parsing
164+
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system-both");
164165
if (!source.isEmpty()) {
165166
properties.setProperty(JMX_TARGET_SOURCE, source);
166167
}
167168

168169
JmxScraperConfig config = fromConfig(TestUtil.configProperties(properties));
169170

170171
// should resolve to instrumentation when available in both
171-
shouldResolveToInstrumentationYaml(config, "fake-test-system1");
172+
shouldResolveToInstrumentationYaml(config, "fake-test-system-both");
172173

173174
// should resolve to legacy yaml when not available in instrumentation
174-
shouldResolveToLegacyYaml(config, "fake-test-system2");
175+
shouldResolveToLegacyYaml(config, "fake-test-system-legacy-only");
175176

176177
// should resolve to instrumentation when only defined there
177-
shouldResolveToInstrumentationYaml(config, "fake-test-system3");
178+
shouldResolveToInstrumentationYaml(config, "fake-test-system-instrumentation-only");
178179
}
179180

180181
@Test
181182
void targetSystemSource_legacy() {
182183
Properties properties = (Properties) validProperties.clone();
183-
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system1");
184+
// we just need to provide a valid value for parsing
185+
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system-both");
184186
properties.setProperty(JMX_TARGET_SOURCE, "legacy");
185187

186188
JmxScraperConfig config = fromConfig(TestUtil.configProperties(properties));
187189

188-
shouldResolveToLegacyYaml(config, "fake-test-system1");
190+
shouldResolveToLegacyYaml(config, "fake-test-system-both");
189191

190-
shouldResolveToLegacyYaml(config, "fake-test-system2");
192+
shouldResolveToLegacyYaml(config, "fake-test-system-legacy-only");
191193

192194
// should not support system only defined in instrumentation
193-
shouldNotResolveYaml(config, "fake-test-system3");
195+
shouldNotResolveYaml(config, "fake-test-system-instrumentation-only");
194196
}
195197

196198
@Test
197199
void targetSystemSource_instrumentation() {
198200
Properties properties = (Properties) validProperties.clone();
199-
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system1");
201+
// we just need to provide a valid value for parsing
202+
properties.setProperty(JMX_TARGET_SYSTEM, "fake-test-system-both");
200203
properties.setProperty(JMX_TARGET_SOURCE, "instrumentation");
201204

202205
JmxScraperConfig config = fromConfig(TestUtil.configProperties(properties));
203206

204-
shouldResolveToInstrumentationYaml(config, "fake-test-system1");
207+
shouldResolveToInstrumentationYaml(config, "fake-test-system-both");
205208

206209
// should not support system only defined in legacy
207-
shouldNotResolveYaml(config, "fake-test-system2");
210+
shouldNotResolveYaml(config, "fake-test-system-legacy-only");
208211

209-
shouldResolveToInstrumentationYaml(config, "fake-test-system3");
212+
shouldResolveToInstrumentationYaml(config, "fake-test-system-instrumentation-only");
210213
}
211214

212215
private static InputStream getYaml(String path) {

0 commit comments

Comments
 (0)