Skip to content

Commit

Permalink
Clean up compile warnings in 1.3.x branch (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and shakuzen committed Dec 3, 2019
1 parent 346bfd4 commit 003dc29
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
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;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
Expand Down

0 comments on commit 003dc29

Please sign in to comment.