From 97c103d8f485ddfee04e50c48a092cbe3af54603 Mon Sep 17 00:00:00 2001 From: Eric Deandrea Date: Wed, 20 Dec 2023 09:06:33 -0500 Subject: [PATCH] Attempt to fix delay tests (#36) --- src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java b/src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java index 8eeed82..ef1929f 100644 --- a/src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java +++ b/src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java @@ -17,7 +17,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; -import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -34,6 +33,7 @@ import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.StatusRuntimeException; +import java.time.Duration; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -269,7 +269,7 @@ void fixedDelay() { stopwatch.stop(); assertThat(greeting, is("Delayed hello")); - assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(1000L)); + assertThat(stopwatch.elapsed(), greaterThanOrEqualTo(Duration.ofMillis(1000L))); } @Test @@ -284,6 +284,6 @@ void randomDelay() { stopwatch.stop(); assertThat(greeting, is("Delayed hello")); - assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(500L)); + assertThat(stopwatch.elapsed(), greaterThanOrEqualTo(Duration.ofMillis(500L))); } }