Skip to content

Commit

Permalink
Drop AssertThatThrownBy suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Dec 23, 2024
1 parent 775f665 commit 77ddee5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
25 changes: 18 additions & 7 deletions integration-tests/prometheus-java-client-expected-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9472,26 +9472,37 @@
}
--- a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java
+++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java
@@ -2,15 +2,16 @@ package io.prometheus.metrics.model.snapshots;
@@ -1,16 +1,16 @@
package io.prometheus.metrics.model.snapshots;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.InstanceOfAssertFactories.throwable;

import org.junit.jupiter.api.Test;

-class MetricSnapshotTest {
+final class MetricSnapshotTest {

// XXX: Investigate the `satisfies` and how to rewrite this.
@SuppressWarnings("AssertThatThrownBy")
@Test
- public void testDuplicateLabels() {
- assertThatExceptionOfType(DuplicateLabelsException.class)
- .isThrownBy(
+ void duplicateLabels() {
assertThatExceptionOfType(DuplicateLabelsException.class)
.isThrownBy(
+ assertThatThrownBy(
() ->
@@ -41,14 +42,14 @@ class MetricSnapshotTest {
CounterSnapshot.builder()
.name("events")
@@ -30,6 +30,7 @@ class MetricSnapshotTest {
.value(3.0)
.build())
.build())
+ .asInstanceOf(throwable(DuplicateLabelsException.class))
.satisfies(
e -> {
assertThat(e.getMetadata().getName()).isEqualTo("events");
@@ -39,14 +40,14 @@ class MetricSnapshotTest {
}

@Test
Expand Down
11 changes: 0 additions & 11 deletions integration-tests/prometheus-java-client-init.patch
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,3 @@
</path>
<!-- Other annotation processors go here.

--- a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java
+++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java
@@ -7,6 +7,8 @@ import org.junit.jupiter.api.Test;

class MetricSnapshotTest {

+ // XXX: Investigate the `satisfies` and how to rewrite this.
+ @SuppressWarnings("AssertThatThrownBy")
@Test
public void testDuplicateLabels() {
assertThatExceptionOfType(DuplicateLabelsException.class)

0 comments on commit 77ddee5

Please sign in to comment.