From 2cca11c3b7afc80d4a17dac5b077b4976a085148 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 10 May 2024 09:36:12 +0000 Subject: [PATCH] remove public modifiers. --- .../v1beta1/it/ITAutoPopulatedFields.java | 21 ++++++----- .../showcase/v1beta1/it/ITBidiStreaming.java | 6 ++-- .../showcase/v1beta1/it/ITClientShutdown.java | 14 ++++---- .../v1beta1/it/ITClientSideStreaming.java | 8 ++--- .../v1beta1/it/ITCommonServiceMixins.java | 12 +++---- .../google/showcase/v1beta1/it/ITCrud.java | 10 +++--- .../v1beta1/it/ITDynamicRoutingHeaders.java | 36 +++++++++---------- .../v1beta1/it/ITEndpointContext.java | 29 ++++++++------- .../google/showcase/v1beta1/it/ITGdch.java | 11 +++--- .../showcase/v1beta1/it/ITHttpAnnotation.java | 6 ++-- .../com/google/showcase/v1beta1/it/ITIam.java | 20 +++++------ .../v1beta1/it/ITLongRunningOperation.java | 11 +++--- .../showcase/v1beta1/it/ITNumericEnums.java | 6 ++-- .../showcase/v1beta1/it/ITOtelMetrics.java | 28 +++++++-------- .../showcase/v1beta1/it/ITPagination.java | 8 ++--- .../v1beta1/it/ITServerSideStreaming.java | 16 ++++----- .../showcase/v1beta1/it/ITUnaryCallable.java | 12 +++---- .../showcase/v1beta1/it/ITUnaryDeadline.java | 20 +++++------ 18 files changed, 133 insertions(+), 141 deletions(-) diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java index f9595df978..3a2a68a1c0 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java @@ -121,7 +121,7 @@ public void sendMessage(ReqT message) { private EchoClient httpJsonClientWithRetries; @BeforeEach - public void createClients() throws Exception { + void createClients() throws Exception { RetrySettings defaultRetrySettings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(5000L)) @@ -157,14 +157,14 @@ public void createClients() throws Exception { } @AfterEach - public void destroyClient() { + void destroyClient() { grpcClientWithoutRetries.close(); grpcClientWithRetries.close(); httpJsonClient.close(); } @Test - public void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { List capturedRequestIds = new ArrayList<>(); grpcRequestInterceptor.setOnRequestIntercepted( request -> { @@ -181,7 +181,7 @@ public void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { } @Test - public void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { + void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { List capturedRequestIds = new ArrayList<>(); grpcRequestInterceptor.setOnRequestIntercepted( request -> { @@ -197,7 +197,7 @@ public void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { } @Test - public void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { List capturedRequestIds = new ArrayList<>(); httpJsonInterceptor.setOnRequestIntercepted( request -> { @@ -214,7 +214,7 @@ public void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { } @Test - public void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { + void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { String UUIDsent = UUID.randomUUID().toString(); List capturedRequestIds = new ArrayList<>(); httpJsonInterceptor.setOnRequestIntercepted( @@ -230,7 +230,7 @@ public void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { } @Test - public void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { List capturedRequestIds = new ArrayList<>(); grpcRequestInterceptor.setOnRequestIntercepted( request -> { @@ -264,7 +264,7 @@ public void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() thr } @Test - public void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { List capturedRequestIds = new ArrayList<>(); grpcRequestInterceptor.setOnRequestIntercepted( request -> { @@ -302,8 +302,7 @@ public void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() thro } @Test - public void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() - throws Exception { + void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { List capturedRequestIds = new ArrayList<>(); httpJsonInterceptor.setOnRequestIntercepted( request -> { @@ -336,7 +335,7 @@ public void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() } @Test - public void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { List capturedRequestIds = new ArrayList<>(); httpJsonInterceptor.setOnRequestIntercepted( request -> { diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java index 0a47592e7b..72b8f1b0de 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java @@ -39,13 +39,13 @@ class ITBidiStreaming { private static EchoClient grpcClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); } @AfterAll - public static void destroyClients() throws Exception { + static void destroyClients() throws Exception { grpcClient.close(); grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); } @@ -57,7 +57,7 @@ public static void destroyClients() throws Exception { // three requests, respond twice for every request etc. If that happens, the response content may // not be exactly the same as request content. @Test - public void testGrpc_splitCall_shouldListensToResponse() throws Exception { + void testGrpc_splitCall_shouldListensToResponse() throws Exception { // given List expected = Arrays.asList("The rain in Spain stays mainly on the plain".split(" ")); TestResponseObserver responseObserver = new TestResponseObserver(); diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java index 2e384139a7..e55ee8d1ed 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java @@ -36,7 +36,7 @@ class ITClientShutdown { // Test to ensure the client can close + terminate properly @Test @Timeout(15) - public void testGrpc_closeClient() throws Exception { + void testGrpc_closeClient() throws Exception { EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); assertClientTerminated(grpcClient); } @@ -44,7 +44,7 @@ public void testGrpc_closeClient() throws Exception { // Test to ensure the client can close + terminate properly @Test @Timeout(15) - public void testHttpJson_closeClient() throws Exception { + void testHttpJson_closeClient() throws Exception { EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); assertClientTerminated(httpjsonClient); } @@ -52,7 +52,7 @@ public void testHttpJson_closeClient() throws Exception { // Test to ensure the client can close + terminate after a quick RPC invocation @Test @Timeout(15) - public void testGrpc_rpcInvoked_closeClient() throws Exception { + void testGrpc_rpcInvoked_closeClient() throws Exception { EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); // Response is ignored for this test grpcClient.echo(EchoRequest.newBuilder().setContent("Test").build()); @@ -62,7 +62,7 @@ public void testGrpc_rpcInvoked_closeClient() throws Exception { // Test to ensure the client can close + terminate after a quick RPC invocation @Test @Timeout(15) - public void testHttpJson_rpcInvoked_closeClient() throws Exception { + void testHttpJson_rpcInvoked_closeClient() throws Exception { EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); // Response is ignored for this test httpjsonClient.echo(EchoRequest.newBuilder().setContent("Test").build()); @@ -74,8 +74,7 @@ public void testHttpJson_rpcInvoked_closeClient() throws Exception { // the test does not continue on forever. @Test @Timeout(15) - public void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() - throws Exception { + void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC // invocation should time out in 15s, but the client will receive a response in 2s. // Any outstanding tasks (timeout tasks) should be cancelled once a response has been @@ -108,8 +107,7 @@ public void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived( // the test does not continue on forever. @Test @Timeout(15) - public void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() - throws Exception { + void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC // invocation should time out in 15s, but the client will receive a response in 2s. // Any outstanding tasks (timeout tasks) should be cancelled once a response has been diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java index aab041982a..61b507f49a 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java @@ -41,19 +41,19 @@ class ITClientSideStreaming { private static EchoClient grpcClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { grpcClient.close(); grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); } @Test - public void testGrpc_sendStreamedContent_receiveConcatenatedResponse() + void testGrpc_sendStreamedContent_receiveConcatenatedResponse() throws ExecutionException, InterruptedException { CollectStreamObserver responseObserver = new CollectStreamObserver<>(); ApiStreamObserver requestObserver = @@ -71,7 +71,7 @@ public void testGrpc_sendStreamedContent_receiveConcatenatedResponse() } @Test - public void testGrpc_sendStreamedContent_handleServerError() { + void testGrpc_sendStreamedContent_handleServerError() { CollectStreamObserver responseObserver = new CollectStreamObserver<>(); ApiStreamObserver requestObserver = grpcClient.collectCallable().clientStreamingCall(responseObserver); diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java index 12bb2db890..a64f95a258 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java @@ -57,7 +57,7 @@ class ITCommonServiceMixins { private static EchoClient httpjsonClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); @@ -66,7 +66,7 @@ public static void createClients() throws Exception { } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { grpcClient.close(); httpjsonClient.close(); @@ -76,7 +76,7 @@ public static void destroyClients() throws InterruptedException { } @Test - public void testGrpc_getLocation() { + void testGrpc_getLocation() { GetLocationRequest request = GetLocationRequest.newBuilder().setName("projects/showcase/location/us-central1").build(); Location location = grpcClient.getLocation(request); @@ -89,7 +89,7 @@ public void testGrpc_getLocation() { } @Test - public void testGrpc_listLocations() { + void testGrpc_listLocations() { ListLocationsRequest request = ListLocationsRequest.newBuilder().setName("projects/showcase").build(); EchoClient.ListLocationsPagedResponse locationsPagedResponse = @@ -104,7 +104,7 @@ public void testGrpc_listLocations() { } @Test - public void testHttpJson_getLocation() { + void testHttpJson_getLocation() { GetLocationRequest request = GetLocationRequest.newBuilder().setName("projects/showcase/locations/us-central1").build(); Location location = httpjsonClient.getLocation(request); @@ -117,7 +117,7 @@ public void testHttpJson_getLocation() { } @Test - public void testHttpJson_listLocations() { + void testHttpJson_listLocations() { ListLocationsRequest request = ListLocationsRequest.newBuilder().setName("projects/showcase").build(); EchoClient.ListLocationsPagedResponse locationsPagedResponse = diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java index de44cc4889..2bd0f770ed 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java @@ -68,7 +68,7 @@ public static void destroyClients() throws InterruptedException { } @BeforeEach - public void cleanupData() { + void cleanupData() { IdentityClient.ListUsersPagedResponse pagedResponse = grpcClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); for (IdentityClient.ListUsersPage listUsersPage : pagedResponse.iteratePages()) { @@ -81,7 +81,7 @@ public void cleanupData() { } @Test - public void testHttpJson_Create() { + void testHttpJson_Create() { User userResponse = createDefaultUser(); // These properties should be the same @@ -99,7 +99,7 @@ public void testHttpJson_Create() { } @Test - public void testHttpJson_Read() { + void testHttpJson_Read() { List expectedUsersList = ImmutableList.of( createDefaultUser(), @@ -126,7 +126,7 @@ public void testHttpJson_Read() { } @Test - public void testHttpJson_Update() { + void testHttpJson_Update() { User userResponse = createDefaultUser(); // Update multiple fields in the User. Age + Nickname are not included in the FieldMask // userResponse's enableNotifications field is populated from the server @@ -161,7 +161,7 @@ public void testHttpJson_Update() { } @Test - public void testHttpJson_Delete() { + void testHttpJson_Delete() { User userResponse = createDefaultUser(); httpjsonClient.deleteUser( diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java index bfa8f5ea1c..a1f34f5591 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java @@ -128,7 +128,7 @@ public void onClose(int statusCode, HttpJsonMetadata trailers) { private ComplianceClient httpJsonComplianceClient; @BeforeEach - public void createClients() throws Exception { + void createClients() throws Exception { // Create gRPC Interceptor and Client grpcInterceptor = new GrpcCapturingClientInterceptor(); grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); @@ -154,7 +154,7 @@ public void createClients() throws Exception { } @AfterEach - public void destroyClient() throws InterruptedException { + void destroyClient() throws InterruptedException { grpcClient.close(); grpcComplianceClient.close(); @@ -172,35 +172,35 @@ public void destroyClient() throws InterruptedException { } @Test - public void testGrpc_noRoutingHeaderUsed() { + void testGrpc_noRoutingHeaderUsed() { grpcClient.echo(EchoRequest.newBuilder().build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNull(); } @Test - public void testHttpJson_noRoutingHeaderUsed() { + void testHttpJson_noRoutingHeaderUsed() { httpJsonClient.echo(EchoRequest.newBuilder().build()); String headerValue = httpJsonInterceptor.requestParam; assertThat(headerValue).isNull(); } @Test - public void testGrpc_emptyHeader() { + void testGrpc_emptyHeader() { grpcClient.echo(EchoRequest.newBuilder().setHeader("").build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNull(); } @Test - public void testHttpJson_emptyHeader() { + void testHttpJson_emptyHeader() { httpJsonClient.echo(EchoRequest.newBuilder().setHeader("").build()); String headerValue = httpJsonInterceptor.requestParam; assertThat(headerValue).isNull(); } @Test - public void testGrpc_matchesHeaderName() { + void testGrpc_matchesHeaderName() { grpcClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNotNull(); @@ -211,7 +211,7 @@ public void testGrpc_matchesHeaderName() { } @Test - public void testGrpc_implicitHeaders_enumsEncodedasInt() { + void testGrpc_implicitHeaders_enumsEncodedasInt() { RepeatRequest request = RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFKingdomValue(5)).build(); RepeatResponse actualResponse = grpcComplianceClient.repeatDataSimplePath(request); @@ -228,7 +228,7 @@ public void testGrpc_implicitHeaders_enumsEncodedasInt() { } @Test - public void testHttpJson_implicitHeaders_enumsEncodedasInt() { + void testHttpJson_implicitHeaders_enumsEncodedasInt() { RepeatRequest request = RepeatRequest.newBuilder() .setInfo( @@ -256,7 +256,7 @@ public void testHttpJson_implicitHeaders_enumsEncodedasInt() { } @Test - public void testHttpJson_matchesHeaderName() { + void testHttpJson_matchesHeaderName() { httpJsonClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); String headerValue = httpJsonInterceptor.requestParam; assertThat(headerValue).isNotNull(); @@ -267,7 +267,7 @@ public void testHttpJson_matchesHeaderName() { } @Test - public void testGrpc_matchesOtherHeaderName() { + void testGrpc_matchesOtherHeaderName() { grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNotNull(); @@ -278,7 +278,7 @@ public void testGrpc_matchesOtherHeaderName() { } @Test - public void testHttpJson_matchesOtherHeaderName() { + void testHttpJson_matchesOtherHeaderName() { httpJsonClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); String headerValue = httpJsonInterceptor.requestParam; assertThat(headerValue).isNotNull(); @@ -289,7 +289,7 @@ public void testHttpJson_matchesOtherHeaderName() { } @Test - public void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { + void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { grpcClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNotNull(); @@ -306,7 +306,7 @@ public void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { } @Test - public void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { httpJsonClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); String headerValue = httpJsonInterceptor.requestParam; assertThat(headerValue).isNotNull(); @@ -323,7 +323,7 @@ public void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { } @Test - public void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); assertThat(headerValue).isNotNull(); @@ -335,7 +335,7 @@ public void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { } @Test - public void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { httpJsonClient.echo( EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); String headerValue = httpJsonInterceptor.requestParam; @@ -348,7 +348,7 @@ public void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { } @Test - public void testGrpc_matchesMultipleRoutingHeaders() { + void testGrpc_matchesMultipleRoutingHeaders() { grpcClient.echo( EchoRequest.newBuilder() .setHeader("regions/123/zones/456") @@ -369,7 +369,7 @@ public void testGrpc_matchesMultipleRoutingHeaders() { } @Test - public void testHttpJson_matchesMultipleRoutingHeaders() { + void testHttpJson_matchesMultipleRoutingHeaders() { httpJsonClient.echo( EchoRequest.newBuilder() .setHeader("regions/123/zones/456") diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java index 8e5a492221..abf3844a6f 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java @@ -222,7 +222,7 @@ public Credentials getCredentials() { private EchoClient echoClient; @AfterEach - public void cleanup() throws InterruptedException { + void cleanup() throws InterruptedException { if (echoClient != null) { echoClient.close(); echoClient.awaitTermination( @@ -232,7 +232,7 @@ public void cleanup() throws InterruptedException { // Default (no configuration) @Test - public void endpointResolution_default() throws IOException { + void endpointResolution_default() throws IOException { EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) @@ -245,7 +245,7 @@ public void endpointResolution_default() throws IOException { // User configuration @Test - public void endpointResolution_userSetEndpoint() throws IOException { + void endpointResolution_userSetEndpoint() throws IOException { String customEndpoint = "test.com:123"; EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() @@ -259,7 +259,7 @@ public void endpointResolution_userSetEndpoint() throws IOException { } @Test - public void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { + void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { String customUniverseDomain = "random.com"; EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() @@ -273,7 +273,7 @@ public void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throw } @Test - public void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { + void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { String customEndpoint = "custom.endpoint.com:443"; String customUniverseDomain = "random.com"; EchoSettings echoSettings = @@ -291,7 +291,7 @@ public void endpointResolution_userSetEndpointAndUniverseDomain() throws IOExcep } @Test - public void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { + void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) @@ -308,7 +308,7 @@ public void universeDomainValidation_credentialsGDU_noUserConfiguration() throws } @Test - public void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { + void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() .setCredentialsProvider(UniverseDomainCredentialsProvider.create("random.com")) @@ -328,8 +328,7 @@ public void universeDomainValidation_credentialsNonGDU_noUserConfiguration() thr } @Test - public void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() - throws IOException { + void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() throws IOException { String universeDomain = "random.com"; EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() @@ -348,7 +347,7 @@ public void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() } @Test - public void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() + void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() throws IOException { String universeDomain = "random.com"; String userConfigurationUniverseDomain = "test.com"; @@ -373,7 +372,7 @@ public void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfigurat // This test uses NoCredentialsProvider (will default to GDU) @Test - public void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { + void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() .setCredentialsProvider(NoCredentialsProvider.create()) @@ -391,7 +390,7 @@ public void universeDomainValidation_noCredentials_noUserSetUniverseDomain() thr // This test uses NoCredentialsProvider (will default to GDU) @Test - public void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { + void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { String universeDomain = "random.com"; EchoSettings echoSettings = ExtendedEchoSettings.newBuilder() @@ -414,7 +413,7 @@ public void universeDomainValidation_noCredentials_userSetUniverseDomain() throw // Default in Builder (no configuration) @Test - public void endpointResolution_defaultViaBuilder() { + void endpointResolution_defaultViaBuilder() { EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); // `StubSettings.newBuilder()` will return the clientSettingsEndpoint Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo(null); @@ -422,7 +421,7 @@ public void endpointResolution_defaultViaBuilder() { // User configuration in Builder @Test - public void endpointResolution_userConfigurationViaBuilder() { + void endpointResolution_userConfigurationViaBuilder() { EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder().setEndpoint("test.com:123"); // `StubSettings.newBuilder()` will return the clientSettingsEndpoint @@ -430,7 +429,7 @@ public void endpointResolution_userConfigurationViaBuilder() { } @Test - public void endpointResolution_builderBuilderBackToBuilder() throws IOException { + void endpointResolution_builderBuilderBackToBuilder() throws IOException { String customEndpoint = "test.com:123"; EchoStubSettings.Builder echoStubSettingsBuilder = EchoStubSettings.newBuilder().setEndpoint(customEndpoint); diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java index c4eb8d1997..fbc3fd8083 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java @@ -75,7 +75,7 @@ class ITGdch { private URI tokenUri; @BeforeEach - public void setup(@TempDir Path tempDir) throws IOException, URISyntaxException { + void setup(@TempDir Path tempDir) throws IOException, URISyntaxException { transportFactory = new InterceptingMockTokenServerTransportFactory(); prepareCredentials(tempDir); settings = @@ -85,7 +85,7 @@ public void setup(@TempDir Path tempDir) throws IOException, URISyntaxException } @AfterEach - public void tearDown() throws InterruptedException { + void tearDown() throws InterruptedException { if (client != null) { client.close(); client.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); @@ -131,7 +131,7 @@ private void prepareCredentials(Path tempDir) throws IOException { * @throws IOException */ @Test - public void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() + void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() throws IOException { // we create the client as usual - no audience passed @@ -176,9 +176,8 @@ public void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointB * @throws IOException */ @Test - public void - testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() - throws IOException { + void testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() + throws IOException { // Similar to the previous test, create a client as usual but this time we pass a explicit // audience. It should diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java index a16af1cba5..a8197396f4 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -65,7 +65,7 @@ public static Stream data() { private static Map> validComplianceRpcMap; @BeforeAll - public static void createClients() throws IOException, GeneralSecurityException { + static void createClients() throws IOException, GeneralSecurityException { ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); JsonFormat.parser() .merge( @@ -109,7 +109,7 @@ public static void createClients() throws IOException, GeneralSecurityException } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { httpjsonClient.close(); httpjsonClient.awaitTermination( TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); @@ -120,7 +120,7 @@ public static void destroyClients() throws InterruptedException { // works as intended @ParameterizedTest @MethodSource("data") - public void testComplianceGroup(String groupName) { + void testComplianceGroup(String groupName) { Optional complianceGroupOptional = complianceSuite.getGroupList().stream() .filter(x -> x.getName().equals(groupName)) diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java index 9041ff0219..893eeb2679 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java @@ -46,13 +46,13 @@ class ITIam { private String resourceName; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { grpcClient = TestClientInitializer.createGrpcIdentityClient(); httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); } @BeforeEach - public void setupTests() { + void setupTests() { resourceName = "users/" + UUID.randomUUID().toString().substring(0, 8); } @@ -67,7 +67,7 @@ public static void destroyClients() throws InterruptedException { } @Test - public void testGrpc_setIamPolicy() { + void testGrpc_setIamPolicy() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -78,7 +78,7 @@ public void testGrpc_setIamPolicy() { } @Test - public void testHttpJson_setIamPolicy() { + void testHttpJson_setIamPolicy() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -89,7 +89,7 @@ public void testHttpJson_setIamPolicy() { } @Test - public void testGrpc_getIamPolicy() { + void testGrpc_getIamPolicy() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -104,7 +104,7 @@ public void testGrpc_getIamPolicy() { } @Test - public void testHttpJson_getIamPolicy() { + void testHttpJson_getIamPolicy() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -119,7 +119,7 @@ public void testHttpJson_getIamPolicy() { } @Test - public void testGrpc_testIamPermissions() { + void testGrpc_testIamPermissions() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -140,7 +140,7 @@ public void testGrpc_testIamPermissions() { } @Test - public void testHttpJson_testIamPermissions() { + void testHttpJson_testIamPermissions() { SetIamPolicyRequest policyRequest = SetIamPolicyRequest.newBuilder() .setPolicy(DEFAULT_POLICY) @@ -165,14 +165,14 @@ public void testHttpJson_testIamPermissions() { // cases, and we simply assert that an exception has been thrown for a single case with a single // RPC (No resource in the request for SetIamPolicy's RPC). @Test - public void testGrpc_iamThrowsException() { + void testGrpc_iamThrowsException() { SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); assertThrows( InvalidArgumentException.class, () -> grpcClient.setIamPolicy(setIamPolicyRequest)); } @Test - public void testHttpJson_iamThrowsException() { + void testHttpJson_iamThrowsException() { SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); assertThrows( InvalidArgumentException.class, () -> httpjsonClient.setIamPolicy(setIamPolicyRequest)); diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java index a62ea11909..bab3d04cd5 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java @@ -40,7 +40,7 @@ class ITLongRunningOperation { @Test - public void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { RetrySettings initialUnaryRetrySettings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(3000L)) @@ -79,7 +79,7 @@ public void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Ex } @Test - public void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { RetrySettings initialUnaryRetrySettings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(3000L)) @@ -119,7 +119,7 @@ public void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throw } @Test - public void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() throws Exception { RetrySettings initialUnaryRetrySettings = RetrySettings.newBuilder() @@ -157,9 +157,8 @@ public void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineE } @Test - public void - testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() - throws Exception { + void testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { RetrySettings initialUnaryRetrySettings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(5000L)) diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java index 187a560cd0..76c54a803c 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -37,7 +37,7 @@ class ITNumericEnums { private static ComplianceClient httpjsonClient; @BeforeAll - public static void createClients() throws GeneralSecurityException, IOException { + static void createClients() throws GeneralSecurityException, IOException { ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder() .setCredentialsProvider(NoCredentialsProvider.create()) @@ -52,14 +52,14 @@ public static void createClients() throws GeneralSecurityException, IOException } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { httpjsonClient.close(); httpjsonClient.awaitTermination( TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); } @Test - public void verifyEnums() { + void verifyEnums() { EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); EnumResponse initialResponse = httpjsonClient.getEnum(request); assertEquals(initialResponse, httpjsonClient.verifyEnum(initialResponse)); diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java index 851ac1fbcd..c2ecff034d 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java @@ -142,7 +142,7 @@ private OpenTelemetryMetricsRecorder createOtelMetricsRecorder( } @BeforeEach - public void setup() throws Exception { + void setup() throws Exception { inMemoryMetricReader = InMemoryMetricReader.create(); OpenTelemetryMetricsRecorder otelMetricsRecorder = createOtelMetricsRecorder(inMemoryMetricReader); @@ -155,7 +155,7 @@ public void setup() throws Exception { } @AfterEach - public void cleanup() throws InterruptedException { + void cleanup() throws InterruptedException { inMemoryMetricReader.shutdown(); grpcClient.close(); @@ -290,7 +290,7 @@ private List getMetricDataList() throws InterruptedException { } @Test - public void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { + void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { int attemptCount = 1; EchoRequest echoRequest = EchoRequest.newBuilder().setContent("test_grpc_operation_succeeded").build(); @@ -313,7 +313,7 @@ public void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedExcep @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { + void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { int attemptCount = 1; EchoRequest echoRequest = EchoRequest.newBuilder().setContent("test_http_operation_succeeded").build(); @@ -335,7 +335,7 @@ public void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedE } @Test - public void testGrpc_operationCancelled_recordsMetrics() throws Exception { + void testGrpc_operationCancelled_recordsMetrics() throws Exception { int attemptCount = 1; BlockRequest blockRequest = BlockRequest.newBuilder() @@ -366,7 +366,7 @@ public void testGrpc_operationCancelled_recordsMetrics() throws Exception { @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_operationCancelled_recordsMetrics() throws Exception { + void testHttpJson_operationCancelled_recordsMetrics() throws Exception { int attemptCount = 1; BlockRequest blockRequest = BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().setSeconds(5)).build(); @@ -393,7 +393,7 @@ public void testHttpJson_operationCancelled_recordsMetrics() throws Exception { } @Test - public void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { + void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { int attemptCount = 1; Code statusCode = Code.INVALID_ARGUMENT; BlockRequest blockRequest = @@ -423,7 +423,7 @@ public void testGrpc_operationFailed_recordsMetrics() throws InterruptedExceptio @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { + void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { int attemptCount = 1; Code statusCode = Code.INVALID_ARGUMENT; BlockRequest blockRequest = @@ -452,7 +452,7 @@ public void testHttpJson_operationFailed_recordsMetrics() throws InterruptedExce } @Test - public void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { int attemptCount = 3; Code statusCode = Code.UNAVAILABLE; // A custom EchoClient is used in this test because retries have jitter, and we cannot @@ -519,7 +519,7 @@ public void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Excep @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { int attemptCount = 3; Code statusCode = Code.UNAVAILABLE; // A custom EchoClient is used in this test because retries have jitter, and we cannot @@ -586,7 +586,7 @@ public void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws E } @Test - public void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { int attemptCount = 1; Code statusCode = Code.INVALID_ARGUMENT; BlockRequest blockRequest = @@ -614,7 +614,7 @@ public void testGrpc_attemptPermanentFailure_recordsMetrics() throws Interrupted @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { int attemptCount = 1; Code statusCode = Code.INVALID_ARGUMENT; BlockRequest blockRequest = @@ -641,7 +641,7 @@ public void testHttpJson_attemptPermanentFailure_recordsMetrics() throws Interru } @Test - public void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { + void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { int attemptCount = 3; // Disable Jitter on this test to try and ensure that the there are 3 attempts made // for test. The first two calls should result in a DEADLINE_EXCEEDED exception as @@ -715,7 +715,7 @@ public void testGrpc_multipleFailedAttempts_successfulOperation() throws Excepti @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2503") @Test - public void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { + void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { int attemptCount = 3; RetrySettings retrySettings = RetrySettings.newBuilder() diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java index 73dc14fbfc..ebcabeab9e 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java @@ -33,7 +33,7 @@ class ITPagination { private static EchoClient httpjsonClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); // Create Http JSON Echo Client @@ -41,7 +41,7 @@ public static void createClients() throws Exception { } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { grpcClient.close(); httpjsonClient.close(); @@ -60,7 +60,7 @@ public static void destroyClients() throws InterruptedException { // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 @Test - public void testPagedExpandWithTokenGrpc() { + void testPagedExpandWithTokenGrpc() { int pageSize = 2; int pageToken = 3; String content = "A series of words that will be sent back one by one"; @@ -97,7 +97,7 @@ public void testPagedExpandWithTokenGrpc() { // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 @Test - public void testPagedExpandWithTokenHttpJson() { + void testPagedExpandWithTokenHttpJson() { int pageSize = 2; int pageToken = 3; String content = "A series of words that will be sent back one by one"; diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java index bf01099b09..8439e19411 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java @@ -49,7 +49,7 @@ class ITServerSideStreaming { private static EchoClient httpjsonClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); // Create Http JSON Echo Client @@ -57,7 +57,7 @@ public static void createClients() throws Exception { } @AfterAll - public static void destroyClients() throws InterruptedException { + static void destroyClients() throws InterruptedException { grpcClient.close(); httpjsonClient.close(); @@ -67,7 +67,7 @@ public static void destroyClients() throws InterruptedException { } @Test - public void testGrpc_receiveStreamedContent() { + void testGrpc_receiveStreamedContent() { String content = "The rain in Spain stays mainly on the plain!"; ServerStream responseStream = grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); @@ -84,7 +84,7 @@ public void testGrpc_receiveStreamedContent() { } @Test - public void testGrpc_receiveStreamedContentStreamAPI() { + void testGrpc_receiveStreamedContentStreamAPI() { String content = "The rain in Spain stays mainly on the plain!"; ServerStream responseStream = grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); @@ -96,7 +96,7 @@ public void testGrpc_receiveStreamedContentStreamAPI() { } @Test - public void testGrpc_serverError_receiveErrorAfterLastWordInStream() { + void testGrpc_serverError_receiveErrorAfterLastWordInStream() { String content = "The rain in Spain"; Status cancelledStatus = Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); @@ -116,7 +116,7 @@ public void testGrpc_serverError_receiveErrorAfterLastWordInStream() { } @Test - public void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { + void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { EchoSettings.Builder settings = EchoSettings.newBuilder() .setCredentialsProvider(NoCredentialsProvider.create()) @@ -160,7 +160,7 @@ public void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception } @Test - public void testHttpJson_receiveStreamedContent() { + void testHttpJson_receiveStreamedContent() { String content = "The rain in Spain stays mainly on the plain!"; ServerStream responseStream = httpjsonClient @@ -181,7 +181,7 @@ public void testHttpJson_receiveStreamedContent() { @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 6c3f4bf030..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 @@ -39,7 +39,7 @@ class ITUnaryCallable { private static EchoClient httpjsonClient; @BeforeAll - public static void createClients() throws Exception { + static void createClients() throws Exception { // Create gRPC Echo Client grpcClient = TestClientInitializer.createGrpcEchoClient(); // Create Http JSON Echo Client @@ -47,7 +47,7 @@ public static void createClients() throws Exception { } @AfterAll - public static void destroyClients() throws InterruptedException { + 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 98a507e5fe..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 @@ -42,7 +42,7 @@ 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 =