Skip to content

Commit d9918ac

Browse files
committed
spotless
1 parent 6e1400c commit d9918ac

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/config/JmxScraperConfig.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ public static JmxScraperConfig fromConfig(ConfigProperties config) {
150150
// providing compatibility with the deprecated 'otel.jmx.custom.scraping.config' config option
151151
String jmxConfigDeprecated = config.getString(JMX_CONFIG_LEGACY);
152152
if (jmxConfigDeprecated != null) {
153-
logger.warning(JMX_CONFIG_LEGACY + " deprecated option is used, replacing with '" + JMX_CONFIG
154-
+ "' is recommended");
153+
logger.warning(
154+
JMX_CONFIG_LEGACY
155+
+ " deprecated option is used, replacing with '"
156+
+ JMX_CONFIG
157+
+ "' is recommended");
155158
List<String> list = new ArrayList<>(jmxConfig);
156159
list.add(jmxConfigDeprecated);
157160
jmxConfig = list;

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ void shouldPassValidation() {
6464

6565
@ParameterizedTest(name = "custom yaml = {arguments}")
6666
@ValueSource(booleans = {true, false})
67-
public void shouldCreateMinimalValidConfiguration(boolean customYaml){
67+
public void shouldCreateMinimalValidConfiguration(boolean customYaml) {
6868
// Given
6969
Properties properties = new Properties();
7070
properties.setProperty(JMX_SERVICE_URL, "jservice:jmx:rmi:///jndi/rmi://localhost:9010/jmxrmi");
71-
if(customYaml){
71+
if (customYaml) {
7272
properties.setProperty(JMX_CONFIG, "/file.yaml");
7373
} else {
7474
properties.setProperty(JMX_TARGET_SYSTEM, "tomcat");
@@ -81,15 +81,14 @@ public void shouldCreateMinimalValidConfiguration(boolean customYaml){
8181
assertThat(config.getServiceUrl())
8282
.isEqualTo("jservice:jmx:rmi:///jndi/rmi://localhost:9010/jmxrmi");
8383

84-
if(customYaml){
84+
if (customYaml) {
8585
assertThat(config.getJmxConfig()).containsExactly("/file.yaml");
8686
assertThat(config.getTargetSystems()).isEmpty();
8787
} else {
8888
assertThat(config.getJmxConfig()).isEmpty();
8989
assertThat(config.getTargetSystems()).containsExactly("tomcat");
9090
}
9191

92-
9392
assertThat(config.getSamplingInterval())
9493
.describedAs("default sampling interval must align to default metric export interval")
9594
.isEqualTo(Duration.ofMinutes(1));
@@ -136,8 +135,7 @@ void shouldFailValidation_missingConfigPathAndTargetSystem() {
136135
// When and Then
137136
assertThatThrownBy(() -> fromConfig(TestUtil.configProperties(properties)))
138137
.isInstanceOf(ConfigurationException.class)
139-
.hasMessage(
140-
"at least one of 'otel.jmx.target.system' or 'otel.jmx.config' must be set");
138+
.hasMessage("at least one of 'otel.jmx.target.system' or 'otel.jmx.config' must be set");
141139
}
142140

143141
@Test

0 commit comments

Comments
 (0)