Skip to content

Commit 0d0919f

Browse files
committed
fix lint
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 2bc3422 commit 0d0919f

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

integration-tests/it-common/src/test/java/io/prometheus/client/it/common/LogConsumer.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ public static LogConsumer withPrefix(String prefix) {
1919
@Override
2020
public void accept(OutputFrame outputFrame) {
2121
switch (outputFrame.getType()) {
22-
case STDOUT:
23-
System.out.print(prefix + " - " + outputFrame.getUtf8String());
24-
break;
25-
case END:
26-
System.out.println(prefix + " - END");
27-
break;
28-
default: // STDERR or unexpected
29-
System.err.print(prefix + " - " + outputFrame.getUtf8String());
30-
break;
22+
case STDOUT -> System.out.print(prefix + " - " + outputFrame.getUtf8String());
23+
case END -> System.out.println(prefix + " - END");
24+
default -> // STDERR or unexpected
25+
System.err.print(prefix + " - " + outputFrame.getUtf8String());
3126
}
3227
}
3328
}

prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/HistogramSnapshotTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ public void testGoodCaseComplete() {
105105
int i = 0;
106106
for (ClassicHistogramBucket bucket : data.getClassicBuckets()) {
107107
switch (i++) {
108-
case 0:
108+
case 0 -> {
109109
assertThat(bucket.getUpperBound()).isEqualTo(128.0);
110110
assertThat(bucket.getCount()).isEqualTo(7);
111-
break;
112-
case 1:
111+
}
112+
case 1 -> {
113113
assertThat(bucket.getUpperBound()).isEqualTo(1024.0);
114114
assertThat(bucket.getCount()).isEqualTo(15);
115-
break;
116-
case 2:
115+
}
116+
case 2 -> {
117117
assertThat(bucket.getUpperBound()).isEqualTo(Double.POSITIVE_INFINITY);
118118
assertThat(bucket.getCount()).isZero();
119-
break;
119+
}
120120
}
121121
}
122122
assertThat(i).as("expecting 3 classic histogram buckets").isEqualTo(3);
@@ -128,33 +128,33 @@ public void testGoodCaseComplete() {
128128
i = 0;
129129
for (NativeHistogramBucket bucket : data.getNativeBucketsForPositiveValues()) {
130130
switch (i++) {
131-
case 0:
131+
case 0 -> {
132132
assertThat(bucket.getBucketIndex()).isOne();
133133
assertThat(bucket.getCount()).isEqualTo(12);
134-
break;
135-
case 1:
134+
}
135+
case 1 -> {
136136
assertThat(bucket.getBucketIndex()).isEqualTo(2);
137137
assertThat(bucket.getCount()).isEqualTo(3);
138-
break;
139-
case 2:
138+
}
139+
case 2 -> {
140140
assertThat(bucket.getBucketIndex()).isEqualTo(4);
141141
assertThat(bucket.getCount()).isEqualTo(2);
142-
break;
142+
}
143143
}
144144
}
145145
assertThat(i).as("expecting 3 native buckets for positive values").isEqualTo(3);
146146
i = 0;
147147
assertThat(data.getNativeBucketsForNegativeValues().size()).isEqualTo(2);
148148
for (NativeHistogramBucket bucket : data.getNativeBucketsForNegativeValues()) {
149149
switch (i++) {
150-
case 0:
150+
case 0 -> {
151151
assertThat(bucket.getBucketIndex()).isEqualTo(-1);
152152
assertThat(bucket.getCount()).isOne();
153-
break;
154-
case 1:
153+
}
154+
case 1 -> {
155155
assertThat(bucket.getBucketIndex()).isZero();
156156
assertThat(bucket.getCount()).isEqualTo(2);
157-
break;
157+
}
158158
}
159159
}
160160
assertThat(i).as("expecting 2 native buckets for positive values").isEqualTo(2);

0 commit comments

Comments
 (0)