Skip to content

Commit 3ce00d5

Browse files
committed
fix: lint
1 parent b84d32c commit 3ce00d5

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/main/java/dev/openfga/sdk/telemetry/Counters.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ public class Counters {
1616
* This counter is emitted once per underlying HTTP request.
1717
* Note: This counter is disabled by default and must be explicitly enabled in TelemetryConfiguration.
1818
*/
19-
public static final Counter REQUEST_COUNT = new Counter(
20-
"fga-client.request.count",
21-
"The total number of HTTP requests made to the FGA server.");
19+
public static final Counter REQUEST_COUNT =
20+
new Counter("fga-client.request.count", "The total number of HTTP requests made to the FGA server.");
2221

2322
private Counters() {} // Instantiation prevented.
2423
}

src/test/java/dev/openfga/sdk/api/configuration/TelemetryConfigurationTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ void testRequestCountIsDisabledByDefault() {
144144
Map<Metric, Map<Attribute, Optional<Object>>> metrics = telemetryConfiguration.metrics();
145145

146146
// Assert
147-
assertFalse(
148-
metrics.containsKey(Counters.REQUEST_COUNT),
149-
"REQUEST_COUNT should not be enabled by default.");
147+
assertFalse(metrics.containsKey(Counters.REQUEST_COUNT), "REQUEST_COUNT should not be enabled by default.");
150148
}
151149

152150
@Test

src/test/java/dev/openfga/sdk/telemetry/MetricsTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ void shouldReturnNullForRequestCountWhenNotConfigured() {
130130
void shouldReturnRequestCountWhenExplicitlyEnabled() {
131131
// given
132132
Map<Attribute, Optional<Object>> attrs = Map.of();
133-
Map<Metric, Map<Attribute, Optional<Object>>> configuredMetrics =
134-
Map.of(Counters.REQUEST_COUNT, attrs);
133+
Map<Metric, Map<Attribute, Optional<Object>>> configuredMetrics = Map.of(Counters.REQUEST_COUNT, attrs);
135134
TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(configuredMetrics);
136135
Configuration config = new Configuration().telemetryConfiguration(telemetryConfiguration);
137136
Metrics metrics = new Metrics(config);
@@ -203,8 +202,7 @@ void shouldDefaultMetricsEnabled() {
203202
assertThat(metrics.getHistogram(Histograms.REQUEST_DURATION, 10.0, Map.of()))
204203
.isNotNull();
205204
// REQUEST_COUNT is disabled by default
206-
assertThat(metrics.getCounter(Counters.REQUEST_COUNT, 1L, Map.of()))
207-
.isNull();
205+
assertThat(metrics.getCounter(Counters.REQUEST_COUNT, 1L, Map.of())).isNull();
208206
}
209207

210208
@Test

0 commit comments

Comments
 (0)