Skip to content

Commit 81fa539

Browse files
committed
fix spotless issues
1 parent 2f25096 commit 81fa539

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/KafkaConnectRuleTest.java

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,13 @@ void taskStatusStateMappingSuperset() throws Exception {
9292
JmxConfig config = loadKafkaConnectConfig();
9393

9494
JmxRule connectorTaskRule =
95-
getRuleForBean(
96-
config, "kafka.connect:type=connector-task-metrics,connector=*,task=*");
95+
getRuleForBean(config, "kafka.connect:type=connector-task-metrics,connector=*,task=*");
9796

9897
StateMapping stateMapping = getMetric(connectorTaskRule, "status").getStateMapping();
9998
assertThat(stateMapping.isEmpty()).isFalse();
10099
assertThat(stateMapping.getStateKeys())
101100
.contains(
102-
"running",
103-
"failed",
104-
"paused",
105-
"unassigned",
106-
"restarting",
107-
"destroyed",
108-
"unknown");
101+
"running", "failed", "paused", "unassigned", "restarting", "destroyed", "unknown");
109102
assertThat(stateMapping.getDefaultStateKey()).isEqualTo("unknown");
110103
assertThat(stateMapping.getStateValue("DESTROYED")).isEqualTo("destroyed");
111104
assertThat(stateMapping.getStateValue("RESTARTING")).isEqualTo("restarting");
@@ -139,8 +132,7 @@ void confluentCompatibleMetricsCollectWithoutApacheOnlyAttributes() throws Excep
139132

140133
startKafkaConnectTelemetry();
141134

142-
assertLongSum(
143-
"kafka.connect.worker.connector.count", Attributes.empty(), 1);
135+
assertLongSum("kafka.connect.worker.connector.count", Attributes.empty(), 1);
144136
assertLongSum("kafka.connect.worker.task.count", Attributes.empty(), 2);
145137

146138
Attributes connectorStatusAttributes =
@@ -151,8 +143,7 @@ void confluentCompatibleMetricsCollectWithoutApacheOnlyAttributes() throws Excep
151143
.put("kafka.connect.connector.type.raw", "source")
152144
.put("kafka.connect.connector.version", "1.2.3")
153145
.build();
154-
assertLongSum(
155-
"kafka.connect.connector.status", connectorStatusAttributes, 1);
146+
assertLongSum("kafka.connect.connector.status", connectorStatusAttributes, 1);
156147

157148
Attributes taskStatusAttributes =
158149
Attributes.builder()
@@ -171,8 +162,7 @@ void confluentCompatibleMetricsCollectWithoutApacheOnlyAttributes() throws Excep
171162
@Test
172163
void apacheSpecificMetricsAreReportedWhenPresent() throws Exception {
173164
registerMBean(
174-
"kafka.connect:type=connect-worker-rebalance-metrics",
175-
mapOf("connect-protocol", "eager"));
165+
"kafka.connect:type=connect-worker-rebalance-metrics", mapOf("connect-protocol", "eager"));
176166

177167
registerMBean(
178168
"kafka.connect:type=connect-worker-metrics,connector=apache-connector",
@@ -224,7 +214,9 @@ void apacheSpecificMetricsAreReportedWhenPresent() throws Exception {
224214
1);
225215

226216
Attributes connectorTaskAttributes =
227-
Attributes.of(io.opentelemetry.api.common.AttributeKey.stringKey("kafka.connect.connector"), "apache-connector");
217+
Attributes.of(
218+
io.opentelemetry.api.common.AttributeKey.stringKey("kafka.connect.connector"),
219+
"apache-connector");
228220
assertLongSum("kafka.connect.worker.connector.task.running", connectorTaskAttributes, 2);
229221

230222
assertLongSum(
@@ -380,7 +372,7 @@ private static void assertLongGauge(String metricName, Attributes attributes, lo
380372
metricName,
381373
metrics ->
382374
metrics.anySatisfy(
383-
metric -> {
375+
metric -> {
384376
boolean matched =
385377
metric.getLongGaugeData().getPoints().stream()
386378
.anyMatch(
@@ -410,7 +402,8 @@ private static boolean attributesMatch(Attributes actual, Attributes expected) {
410402
* Minimal DynamicMBean implementation backed by a simple attribute map. This keeps the functional
411403
* Kafka Connect coverage self contained in the test file.
412404
*/
413-
static class MapBackedDynamicMBean extends NotificationBroadcasterSupport implements DynamicMBean {
405+
static class MapBackedDynamicMBean extends NotificationBroadcasterSupport
406+
implements DynamicMBean {
414407

415408
private final Map<String, Object> attributes;
416409
private long sequenceNumber = 1;
@@ -479,12 +472,7 @@ public MBeanInfo getMBeanInfo() {
479472
(name, value) ->
480473
infos.add(
481474
new javax.management.MBeanAttributeInfo(
482-
name,
483-
value.getClass().getName(),
484-
name + " attribute",
485-
true,
486-
true,
487-
false)));
475+
name, value.getClass().getName(), name + " attribute", true, true, false)));
488476
return new MBeanInfo(
489477
this.getClass().getName(),
490478
"Map backed test MBean",

0 commit comments

Comments
 (0)