Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up compile warnings in 1.3.x branch #1729

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -22,6 +22,7 @@

import java.time.Duration;

@SuppressWarnings("deprecation")
class CloudWatchMeterRegistryCompatibilityTest extends MeterRegistryCompatibilityKit {

private final CloudWatchConfig config = new CloudWatchConfig() {
Expand Down
Expand Up @@ -41,6 +41,7 @@
*
* @author Johnny Lim
*/
@SuppressWarnings("deprecation")
class CloudWatchMeterRegistryTest {
private static final String METER_NAME = "test";
private final CloudWatchConfig config = new CloudWatchConfig() {
Expand Down Expand Up @@ -213,6 +214,7 @@ public void batchSizeShouldWorkOnMetricDatum() throws InterruptedException {
when(this.registry.getMeters()).thenReturn(meters);
doNothing().when(this.registry).sendMetricData(any());
this.registry.publish();
@SuppressWarnings("unchecked")
ArgumentCaptor<List<MetricDatum>> argumentCaptor = ArgumentCaptor.forClass(List.class);
verify(this.registry, times(2)).sendMetricData(argumentCaptor.capture());
List<List<MetricDatum>> allValues = argumentCaptor.getAllValues();
Expand Down
Expand Up @@ -22,6 +22,7 @@
/**
* Test methods in CloudWatchUtils
*/
@SuppressWarnings("deprecation")
class CloudWatchUtilsTest {

private static final double EXPECTED_MIN = 8.515920e-109;
Expand Down
Expand Up @@ -138,7 +138,9 @@ void sendMetricData(List<MetricDatum> metricData) throws InterruptedException {
latch.countDown();
});
try {
latch.await(config.readTimeout().toMillis(), TimeUnit.MILLISECONDS);
@SuppressWarnings("deprecation")
long readTimeoutMillis = config.readTimeout().toMillis();
latch.await(readTimeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
logger.warn("metrics push to cloudwatch took longer than expected");
throw e;
Expand Down
Expand Up @@ -214,6 +214,7 @@ void batchSizeShouldWorkOnMetricDatum() throws InterruptedException {
when(this.registry.getMeters()).thenReturn(meters);
doNothing().when(this.registry).sendMetricData(any());
this.registry.publish();
@SuppressWarnings("unchecked")
ArgumentCaptor<List<MetricDatum>> argumentCaptor = ArgumentCaptor.forClass(List.class);
verify(this.registry, times(2)).sendMetricData(argumentCaptor.capture());
List<List<MetricDatum>> allValues = argumentCaptor.getAllValues();
Expand Down
Expand Up @@ -39,7 +39,7 @@
import java.util.stream.Collectors;

import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static org.assertj.core.api.Java6Assertions.assertThat;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't ban this import. Is there a reason for us being Java 8 base to ever use the Java6Assertions package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shakuzen Not that I know of. I created #1731.

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
Expand Down