responseStream =
httpjsonClient
@@ -178,10 +177,10 @@ public void testHttpJson_receiveStreamedContent() {
.inOrder();
}
- @Ignore(
+ @Disabled(
value = "Ignore until https://github.com/googleapis/gapic-showcase/issues/1286 is resolved")
@Test
- public void testHttpJson_serverError_receiveErrorAfterLastWordInStream() {
+ void testHttpJson_serverError_receiveErrorAfterLastWordInStream() {
String content = "The rain in Spain";
Status cancelledStatus =
Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build();
diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java
index 6c0e860fee..4d6018f6fc 100644
--- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java
+++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java
@@ -17,7 +17,7 @@
package com.google.showcase.v1beta1.it;
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import com.google.api.gax.grpc.GrpcStatusCode;
import com.google.api.gax.rpc.CancelledException;
@@ -28,26 +28,26 @@
import com.google.showcase.v1beta1.EchoResponse;
import com.google.showcase.v1beta1.it.util.TestClientInitializer;
import java.util.concurrent.TimeUnit;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
-public class ITUnaryCallable {
+class ITUnaryCallable {
private static EchoClient grpcClient;
private static EchoClient httpjsonClient;
- @BeforeClass
- public static void createClients() throws Exception {
+ @BeforeAll
+ static void createClients() throws Exception {
// Create gRPC Echo Client
grpcClient = TestClientInitializer.createGrpcEchoClient();
// Create Http JSON Echo Client
httpjsonClient = TestClientInitializer.createHttpJsonEchoClient();
}
- @AfterClass
- public static void destroyClients() throws InterruptedException {
+ @AfterAll
+ static void destroyClients() throws InterruptedException {
grpcClient.close();
httpjsonClient.close();
@@ -57,13 +57,13 @@ public static void destroyClients() throws InterruptedException {
}
@Test
- public void testGrpc_receiveContent() {
+ void testGrpc_receiveContent() {
assertThat(echoGrpc("grpc-echo?")).isEqualTo("grpc-echo?");
assertThat(echoGrpc("grpc-echo!")).isEqualTo("grpc-echo!");
}
@Test
- public void testGrpc_serverResponseError_throwsException() {
+ void testGrpc_serverResponseError_throwsException() {
Status cancelledStatus =
Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build();
EchoRequest requestWithServerError = EchoRequest.newBuilder().setError(cancelledStatus).build();
@@ -73,13 +73,13 @@ public void testGrpc_serverResponseError_throwsException() {
}
@Test
- public void testHttpJson_receiveContent() {
+ void testHttpJson_receiveContent() {
assertThat(echoHttpJson("http-echo?")).isEqualTo("http-echo?");
assertThat(echoHttpJson("http-echo!")).isEqualTo("http-echo!");
}
@Test
- public void testHttpJson_serverResponseError_throwsException() {
+ void testHttpJson_serverResponseError_throwsException() {
EchoRequest requestWithServerError =
EchoRequest.newBuilder()
.setError(Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build())
diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java
index d7d12a4ad5..984598bc9e 100644
--- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java
+++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java
@@ -16,7 +16,7 @@
package com.google.showcase.v1beta1.it;
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.retrying.RetryingFuture;
@@ -29,7 +29,7 @@
import com.google.showcase.v1beta1.it.util.TestClientInitializer;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.threeten.bp.Duration;
/**
@@ -39,10 +39,10 @@
* Each test attempts to get the number of attempts done in each call. The attemptCount is
* incremented by 1 as the first attempt is zero indexed.
*/
-public class ITUnaryDeadline {
+class ITUnaryDeadline {
@Test
- public void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception {
+ void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception {
RetrySettings defaultNoRetrySettings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(5000L))
@@ -76,7 +76,7 @@ public void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws
}
@Test
- public void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception {
+ void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception {
RetrySettings defaultNoRetrySettings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(5000L))
@@ -113,8 +113,7 @@ public void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() thr
// Retry is configured by setting the initial RPC timeout (1.5s) to be less than
// the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay.
@Test
- public void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout()
- throws Exception {
+ void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() throws Exception {
RetrySettings defaultRetrySettings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(1500L))
@@ -148,7 +147,7 @@ public void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTim
// Retry is configured by setting the initial RPC timeout (1.5s) to be less than
// the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay.
@Test
- public void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout()
+ void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout()
throws Exception {
RetrySettings defaultRetrySettings =
RetrySettings.newBuilder()
@@ -184,7 +183,7 @@ public void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTota
// Request is set to block for 6 seconds to allow the RPC to timeout. If retries are
// disabled, the RPC timeout is set to be the totalTimeout (5s).
@Test
- public void
+ void
testGRPC_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException()
throws Exception {
RetrySettings defaultNoRetrySettings =
@@ -227,7 +226,7 @@ public void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTota
// Request is set to block for 6 seconds to allow the RPC to timeout. If retries are
// disabled, the RPC timeout is set to be the totalTimeout (5s).
@Test
- public void
+ void
testHttpJson_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException()
throws Exception {
RetrySettings defaultNoRetrySettings =
@@ -274,9 +273,8 @@ public void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTota
// receive a response from the server (200ms) regardless of it was cancelled, then
// we would expect at most 50 responses.
@Test
- public void
- testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException()
- throws Exception {
+ void testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException()
+ throws Exception {
RetrySettings defaultRetrySettings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(100L))
@@ -324,7 +322,7 @@ public void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTota
// receive a response from the server (200ms) regardless of it was cancelled, then
// we would expect at most 50 responses.
@Test
- public void
+ void
testHttpJson_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException()
throws Exception {
RetrySettings defaultRetrySettings =
diff --git a/showcase/pom.xml b/showcase/pom.xml
index cc884b6ca9..cb17baaa68 100644
--- a/showcase/pom.xml
+++ b/showcase/pom.xml
@@ -54,10 +54,11 @@
0.0.1-SNAPSHOT
- junit
- junit
- 4.13.2
- test
+ org.junit
+ junit-bom
+ 5.10.2
+ pom
+ import
@@ -116,6 +117,15 @@
org.apache.maven.plugins
maven-failsafe-plugin
+
+
+
+
+ org.apache.maven.surefire
+ surefire-junit-platform
+ ${surefire.version}
+
+
org.codehaus.mojo