Skip to content

Commit

Permalink
Sync Dropwizard Metrics integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Dec 27, 2024
1 parent 7daa39a commit 1bdc1f5
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions integration-tests/metrics-expected-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3028,17 +3028,16 @@
SharedMetricRegistries.getDefault();
});
- assertTrue(exception.getMessage().contains("Default registry name has not been set."));
+ assertThat(exception.getMessage().contains("Default registry name has not been set.")).isTrue();
+ assertThat(exception.getMessage()).contains("Default registry name has not been set.");
}

@Test
@@ -81,7 +80,8 @@ class SharedMetricRegistriesTest {
@@ -81,7 +80,7 @@ class SharedMetricRegistriesTest {
SharedMetricRegistries.setDefault("foobah");
SharedMetricRegistries.setDefault("borg");
});
- assertTrue(exception.getMessage().contains("Default metric registry name is already set."));
+ assertThat(exception.getMessage().contains("Default metric registry name is already set."))
+ .isTrue();
+ assertThat(exception.getMessage()).contains("Default metric registry name is already set.");
}

@Test
Expand Down Expand Up @@ -4943,27 +4942,25 @@
SharedHealthCheckRegistries.getDefault();
});
- assertTrue(exception.getMessage().contains("Default registry name has not been set."));
+ assertThat(exception.getMessage().contains("Default registry name has not been set.")).isTrue();
+ assertThat(exception.getMessage()).contains("Default registry name has not been set.");
}

@Test
@@ -85,7 +84,8 @@ class SharedHealthCheckRegistriesTest {
@@ -85,7 +84,7 @@ class SharedHealthCheckRegistriesTest {
SharedHealthCheckRegistries.setDefault("default");
SharedHealthCheckRegistries.setDefault("default");
});
- assertTrue(exception.getMessage().contains("Default health check registry is already set."));
+ assertThat(exception.getMessage().contains("Default health check registry is already set."))
+ .isTrue();
+ assertThat(exception.getMessage()).contains("Default health check registry is already set.");
}

@Test
@@ -97,6 +97,7 @@ class SharedHealthCheckRegistriesTest {
@@ -97,6 +96,6 @@ class SharedHealthCheckRegistriesTest {
SharedHealthCheckRegistries.setDefault("default", new HealthCheckRegistry());
SharedHealthCheckRegistries.setDefault("default", new HealthCheckRegistry());
});
- assertTrue(exception.getMessage().contains("Default health check registry is already set."));
+ assertThat(exception.getMessage().contains("Default health check registry is already set."))
+ .isTrue();
+ assertThat(exception.getMessage()).contains("Default health check registry is already set.");
}
}
--- a/metrics-healthchecks/src/test/java/io/dropwizard/metrics5/health/jvm/ThreadDeadlockHealthCheckTest.java
Expand Down Expand Up @@ -5137,7 +5134,7 @@
- Mockito.verify(registry, Mockito.atLeast(1)).registerGauge(argumentCaptor.capture(), any());
- assertTrue(argumentCaptor.getValue().getKey().contains("some-other-name"));
+ verify(registry, atLeast(1)).registerGauge(argumentCaptor.capture(), any());
+ assertThat(argumentCaptor.getValue().getKey().contains("some-other-name")).isTrue();
+ assertThat(argumentCaptor.getValue().getKey()).contains("some-other-name");
}
}
--- a/metrics-httpclient/src/test/java/io/dropwizard/metrics5/httpclient/InstrumentedHttpClientsTest.java
Expand Down Expand Up @@ -5215,7 +5212,7 @@
- Mockito.verify(registry, Mockito.atLeast(1)).registerGauge(argumentCaptor.capture(), any());
- assertTrue(argumentCaptor.getValue().getKey().contains("some-other-name"));
+ verify(registry, atLeast(1)).registerGauge(argumentCaptor.capture(), any());
+ assertThat(argumentCaptor.getValue().getKey().contains("some-other-name")).isTrue();
+ assertThat(argumentCaptor.getValue().getKey()).contains("some-other-name");
}
}
--- a/metrics-httpclient5/src/test/java/io/dropwizard/metrics5/httpclient5/InstrumentedHttpAsyncClientsTest.java
Expand Down Expand Up @@ -5305,7 +5302,7 @@
- Mockito.verify(registry, Mockito.atLeast(1)).registerGauge(argumentCaptor.capture(), any());
- assertTrue(argumentCaptor.getValue().getKey().contains("some-other-name"));
+ verify(registry, atLeast(1)).registerGauge(argumentCaptor.capture(), any());
+ assertThat(argumentCaptor.getValue().getKey().contains("some-other-name")).isTrue();
+ assertThat(argumentCaptor.getValue().getKey()).contains("some-other-name");
}
}
--- a/metrics-httpclient5/src/test/java/io/dropwizard/metrics5/httpclient5/InstrumentedHttpClientsTest.java
Expand Down

0 comments on commit 1bdc1f5

Please sign in to comment.