Skip to content

Commit

Permalink
Attempt to fix delay tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edeandrea committed Dec 19, 2023
1 parent a832565 commit 0a104bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/org/wiremock/grpc/GrpcAcceptanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -284,6 +284,6 @@ void randomDelay() {
stopwatch.stop();

assertThat(greeting, is("Delayed hello"));
assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(500L));
assertThat(stopwatch.elapsed(), greaterThanOrEqualTo(Duration.ofMullis(500L)));
}
}

0 comments on commit 0a104bd

Please sign in to comment.