> bindings) {
- return setBindings(bindings);
- }
/**
* Replaces the builder's map of bindings with the given map of bindings.
@@ -212,21 +202,6 @@ public final Builder removeIdentity(Role role, Identity first, Identity... other
return this;
}
- /**
- * Sets the policy's etag.
- *
- * Etags are used for optimistic concurrency control as a way to help prevent simultaneous
- * updates of a policy from overwriting each other. It is strongly suggested that systems make
- * use of the etag in the read-modify-write cycle to perform policy updates in order to avoid
- * race conditions. An etag is returned in the response to getIamPolicy, and systems are
- * expected to put that etag in the request to setIamPolicy to ensure that their change will be
- * applied to the same version of the policy. If no etag is provided in the call to
- * setIamPolicy, then the existing policy is overwritten blindly.
- */
- @Deprecated
- protected final Builder etag(String etag) {
- return setEtag(etag);
- }
/**
* Sets the policy's etag.
@@ -244,14 +219,6 @@ protected final Builder setEtag(String etag) {
return this;
}
- /**
- * Sets the version of the policy. The default version is 0, meaning only the "owner", "editor",
- * and "viewer" roles are permitted. If the version is 1, you may also use other roles.
- */
- @Deprecated
- protected final Builder version(int version) {
- return setVersion(version);
- }
/**
* Sets the version of the policy. The default version is 0, meaning only the "owner", "editor",
@@ -287,13 +254,6 @@ public Builder toBuilder() {
return new Builder(this);
}
- /**
- * Returns the map of bindings that comprises the policy.
- */
- @Deprecated
- public Map> bindings() {
- return getBindings();
- }
/**
* Returns the map of bindings that comprises the policy.
@@ -302,21 +262,6 @@ public Map> getBindings() {
return bindings;
}
- /**
- * Returns the policy's etag.
- *
- * Etags are used for optimistic concurrency control as a way to help prevent simultaneous
- * updates of a policy from overwriting each other. It is strongly suggested that systems make
- * use of the etag in the read-modify-write cycle to perform policy updates in order to avoid
- * race conditions. An etag is returned in the response to getIamPolicy, and systems are
- * expected to put that etag in the request to setIamPolicy to ensure that their change will be
- * applied to the same version of the policy. If no etag is provided in the call to
- * setIamPolicy, then the existing policy is overwritten blindly.
- */
- @Deprecated
- public String etag() {
- return getEtag();
- }
/**
* Returns the policy's etag.
@@ -333,14 +278,6 @@ public String getEtag() {
return etag;
}
- /**
- * Returns the version of the policy. The default version is 0, meaning only the "owner",
- * "editor", and "viewer" roles are permitted. If the version is 1, you may also use other roles.
- */
- @Deprecated
- public int version() {
- return getVersion();
- }
/**
* Returns the version of the policy. The default version is 0, meaning only the "owner",
@@ -378,13 +315,6 @@ public boolean equals(Object obj) {
&& Objects.equals(version, other.getVersion());
}
- /**
- * Returns a builder for {@code Policy} objects.
- */
- @Deprecated
- public static Builder builder() {
- return newBuilder();
- }
/**
* Returns a builder for {@code Policy} objects.
diff --git a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java
index a09752692884..aa04baaab1ba 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java
@@ -40,12 +40,6 @@ public interface ReadChannel extends ReadableByteChannel, Closeable, Restorable<
void seek(long position) throws IOException;
- /**
- * Sets the minimum size that will be read by a single RPC.
- * Read data will be locally buffered until consumed.
- */
- @Deprecated
- void chunkSize(int chunkSize);
/**
* Sets the minimum size that will be read by a single RPC.
diff --git a/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java b/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java
index e835ad5d3cd7..f737032cfe7a 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java
@@ -107,16 +107,6 @@ private Builder() {
}
}
- /**
- * Sets retryMinAttempts.
- *
- * @param retryMinAttempts the retryMinAttempts to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder retryMinAttempts(int retryMinAttempts) {
- return setRetryMinAttempts(retryMinAttempts);
- }
/**
* Sets retryMinAttempts.
@@ -129,16 +119,6 @@ public Builder setRetryMinAttempts(int retryMinAttempts) {
return this;
}
- /**
- * Sets retryMaxAttempts.
- *
- * @param retryMaxAttempts the retryMaxAttempts to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder retryMaxAttempts(int retryMaxAttempts) {
- return setRetryMaxAttempts(retryMaxAttempts);
- }
/**
* Sets retryMaxAttempts.
@@ -151,16 +131,6 @@ public Builder setRetryMaxAttempts(int retryMaxAttempts) {
return this;
}
- /**
- * Sets initialRetryDelayMillis.
- *
- * @param initialRetryDelayMillis the initialRetryDelayMillis to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder initialRetryDelayMillis(long initialRetryDelayMillis) {
- return setInitialRetryDelayMillis(initialRetryDelayMillis);
- }
/**
* Sets initialRetryDelayMillis.
@@ -173,16 +143,6 @@ public Builder setInitialRetryDelayMillis(long initialRetryDelayMillis) {
return this;
}
- /**
- * Sets maxRetryDelayMillis.
- *
- * @param maxRetryDelayMillis the maxRetryDelayMillis to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder maxRetryDelayMillis(long maxRetryDelayMillis) {
- return setMaxRetryDelayMillis(maxRetryDelayMillis);
- }
/**
* Sets maxRetryDelayMillis.
@@ -195,16 +155,6 @@ public Builder setMaxRetryDelayMillis(long maxRetryDelayMillis) {
return this;
}
- /**
- * Sets retryDelayBackoffFactor.
- *
- * @param retryDelayBackoffFactor the retryDelayBackoffFactor to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder retryDelayBackoffFactor(double retryDelayBackoffFactor) {
- return setRetryDelayBackoffFactor(retryDelayBackoffFactor);
- }
/**
* Sets retryDelayBackoffFactor.
@@ -217,18 +167,6 @@ public Builder setRetryDelayBackoffFactor(double retryDelayBackoffFactor) {
return this;
}
- /**
- * Sets totalRetryPeriodMillis. Note that App Engine Standard Environment front-end modules have
- * a 60 second deadline for HTTP requests. For that reason, you should set the total retry
- * period to under 60 seconds if you are using it on an App Engine front-end module.
- *
- * @param totalRetryPeriodMillis the totalRetryPeriodMillis to set
- * @return the Builder for chaining
- */
- @Deprecated
- public Builder totalRetryPeriodMillis(long totalRetryPeriodMillis) {
- return setTotalRetryPeriodMillis(totalRetryPeriodMillis);
- }
/**
* Sets totalRetryPeriodMillis. Note that App Engine Standard Environment front-end modules have
@@ -275,13 +213,6 @@ private RetryParams(Builder builder) {
checkArgument(totalRetryPeriodMillis >= 0, "totalRetryPeriodMillis must not be negative");
}
- /**
- * Returns an instance with the default parameters.
- */
- @Deprecated
- public static RetryParams defaultInstance() {
- return getDefaultInstance();
- }
/**
* Returns an instance with the default parameters.
@@ -298,13 +229,6 @@ public static RetryParams noRetries() {
return NO_RETRIES;
}
- /**
- * Returns the retryMinAttempts. Default value is {@value #DEFAULT_RETRY_MIN_ATTEMPTS}.
- */
- @Deprecated
- public int retryMinAttempts() {
- return getRetryMinAttempts();
- }
/**
* Returns the retryMinAttempts. Default value is {@value #DEFAULT_RETRY_MIN_ATTEMPTS}.
@@ -313,13 +237,6 @@ public int getRetryMinAttempts() {
return retryMinAttempts;
}
- /**
- * Returns the retryMaxAttempts. Default value is {@value #DEFAULT_RETRY_MAX_ATTEMPTS}.
- */
- @Deprecated
- public int retryMaxAttempts() {
- return getRetryMaxAttempts();
- }
/**
* Returns the retryMaxAttempts. Default value is {@value #DEFAULT_RETRY_MAX_ATTEMPTS}.
@@ -328,14 +245,6 @@ public int getRetryMaxAttempts() {
return retryMaxAttempts;
}
- /**
- * Returns the initialRetryDelayMillis. Default value is
- * {@value #DEFAULT_INITIAL_RETRY_DELAY_MILLIS}.
- */
- @Deprecated
- public long initialRetryDelayMillis() {
- return getInitialRetryDelayMillis();
- }
/**
* Returns the initialRetryDelayMillis. Default value is
@@ -345,13 +254,6 @@ public long getInitialRetryDelayMillis() {
return initialRetryDelayMillis;
}
- /**
- * Returns the maxRetryDelayMillis. Default values is {@value #DEFAULT_MAX_RETRY_DELAY_MILLIS}.
- */
- @Deprecated
- public long maxRetryDelayMillis() {
- return getMaxRetryDelayMillis();
- }
/**
* Returns the maxRetryDelayMillis. Default values is {@value #DEFAULT_MAX_RETRY_DELAY_MILLIS}.
@@ -360,14 +262,6 @@ public long getMaxRetryDelayMillis() {
return maxRetryDelayMillis;
}
- /**
- * Returns the maxRetryDelayBackoffFactor. Default values is
- * {@value #DEFAULT_RETRY_DELAY_BACKOFF_FACTOR}.
- */
- @Deprecated
- public double retryDelayBackoffFactor() {
- return getRetryDelayBackoffFactor();
- }
/**
* Returns the maxRetryDelayBackoffFactor. Default values is
@@ -377,14 +271,6 @@ public double getRetryDelayBackoffFactor() {
return retryDelayBackoffFactor;
}
- /**
- * Returns the totalRetryPeriodMillis. Default value is
- * {@value #DEFAULT_TOTAL_RETRY_PERIOD_MILLIS}.
- */
- @Deprecated
- public long totalRetryPeriodMillis() {
- return getTotalRetryPeriodMillis();
- }
/**
* Returns the totalRetryPeriodMillis. Default value is
@@ -428,10 +314,6 @@ public String toString() {
return toStringHelper.toString();
}
- @Deprecated
- public static Builder builder() {
- return newBuilder();
- }
public static Builder newBuilder() {
return new Builder();
diff --git a/google-cloud-core/src/main/java/com/google/cloud/Role.java b/google-cloud-core/src/main/java/com/google/cloud/Role.java
index 9444421e6b69..e7742b2b9384 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/Role.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/Role.java
@@ -40,14 +40,6 @@ private Role(String value) {
this.value = value;
}
- /**
- * Returns the string identifier for this role. For example, {@code "roles/viewer"},
- * {@code "roles/editor"}, or {@code "roles/owner"}.
- */
- @Deprecated
- public String value() {
- return getValue();
- }
/**
* Returns the string identifier for this role. For example, {@code "roles/viewer"},
diff --git a/google-cloud-core/src/main/java/com/google/cloud/Service.java b/google-cloud-core/src/main/java/com/google/cloud/Service.java
index 4c64e6fab2fd..3c3c87bd76fa 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/Service.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/Service.java
@@ -22,8 +22,6 @@
* @param the {@code ServiceOptions} subclass corresponding to the service
*/
public interface Service> {
- @Deprecated
- OptionsT options();
OptionsT getOptions();
}
diff --git a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
index 9122aa525bcf..d5b155486b58 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
@@ -135,13 +135,6 @@ protected B self() {
return (B) this;
}
- /**
- * Sets the service factory.
- */
- @Deprecated
- public B serviceFactory(ServiceFactory serviceFactory) {
- return setServiceFactory(serviceFactory);
- }
/**
* Sets the service factory.
@@ -151,17 +144,6 @@ public B setServiceFactory(ServiceFactory serviceFactory) {
return self();
}
- /**
- * Sets the service's clock. The clock is mainly used for testing purpose. {@link Clock} will be
- * replaced by Java8's {@code java.time.Clock}.
- *
- * @param clock the clock to set
- * @return the builder
- */
- @Deprecated
- public B clock(Clock clock) {
- return setClock(clock);
- }
/**
* Sets the service's clock. The clock is mainly used for testing purpose. {@link Clock} will be
@@ -175,16 +157,6 @@ public B setClock(Clock clock) {
return self();
}
- /**
- * Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to
- * attempt getting the project ID from the environment.
- *
- * @return the builder
- */
- @Deprecated
- public B projectId(String projectId) {
- return setProjectId(projectId);
- }
/**
* Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to
@@ -197,15 +169,6 @@ public B setProjectId(String projectId) {
return self();
}
- /**
- * Sets service host.
- *
- * @return the builder
- */
- @Deprecated
- public B host(String host) {
- return setHost(host);
- }
/**
* Sets service host.
@@ -233,17 +196,6 @@ public B setCredentials(Credentials credentials) {
return self();
}
- /**
- * Sets configuration parameters for request retries. If no configuration is set
- * {@link RetryParams#getDefaultInstance()} is used. To disable retries, supply
- * {@link RetryParams#noRetries()} here.
- *
- * @return the builder
- */
- @Deprecated
- public B retryParams(RetryParams retryParams) {
- return setRetryParams(retryParams);
- }
/**
* Sets configuration parameters for request retries. If no configuration is set
@@ -257,15 +209,6 @@ public B setRetryParams(RetryParams retryParams) {
return self();
}
- /**
- * Sets the factory for rpc services.
- *
- * @return the builder
- */
- @Deprecated
- public B serviceRpcFactory(ServiceRpcFactory serviceRpcFactory) {
- return setServiceRpcFactory(serviceRpcFactory);
- }
/**
* Sets the factory for rpc services.
@@ -318,19 +261,11 @@ private static GoogleCredentials defaultCredentials() {
}
}
- @Deprecated
- protected String defaultHost() {
- return getDefaultHost();
- }
protected String getDefaultHost() {
return DEFAULT_HOST;
}
- @Deprecated
- protected String defaultProject() {
- return getDefaultProject();
- }
protected String getDefaultProject() {
return getDefaultProjectId();
@@ -479,10 +414,6 @@ protected static String getServiceAccountProjectId() {
return project;
}
- @Deprecated
- public ServiceT service() {
- return getService();
- }
@SuppressWarnings("unchecked")
public ServiceT getService() {
@@ -492,10 +423,6 @@ public ServiceT getService() {
return service;
}
- @Deprecated
- public ServiceRpcT rpc() {
- return getRpc();
- }
@SuppressWarnings("unchecked")
public ServiceRpcT getRpc() {
@@ -505,14 +432,6 @@ public ServiceRpcT getRpc() {
return rpc;
}
- /**
- * Returns the project ID. Return value can be null (for services that don't require a project
- * ID).
- */
- @Deprecated
- public String projectId() {
- return getProjectId();
- }
/**
* Returns the project ID. Return value can be null (for services that don't require a project
@@ -522,13 +441,6 @@ public String getProjectId() {
return projectId;
}
- /**
- * Returns the service host.
- */
- @Deprecated
- public String host() {
- return getHost();
- }
/**
* Returns the service host.
@@ -556,14 +468,6 @@ public Credentials getScopedCredentials() {
return credentialsToReturn;
}
- /**
- * Returns configuration parameters for request retries. By default requests are retried:
- * {@link RetryParams#getDefaultInstance()} is used.
- */
- @Deprecated
- public RetryParams retryParams() {
- return getRetryParams();
- }
/**
* Returns configuration parameters for request retries. By default requests are retried:
@@ -573,14 +477,6 @@ public RetryParams getRetryParams() {
return retryParams;
}
- /**
- * Returns the service's clock. Default time source uses {@link System#currentTimeMillis()} to get
- * current time.
- */
- @Deprecated
- public Clock clock() {
- return getClock();
- }
/**
* Returns the service's clock. Default time source uses {@link System#currentTimeMillis()} to get
@@ -590,13 +486,6 @@ public Clock getClock() {
return clock;
}
- /**
- * Returns the application's name as a string in the format {@code gcloud-java/[version]}.
- */
- @Deprecated
- public String applicationName() {
- return getApplicationName();
- }
/**
* Returns the application's name as a string in the format {@code gcloud-java/[version]}.
@@ -605,13 +494,6 @@ public String getApplicationName() {
return APPLICATION_NAME;
}
- /**
- * Returns the library's name, {@code gcloud-java}, as a string.
- */
- @Deprecated
- public String libraryName() {
- return getLibraryName();
- }
/**
* Returns the library's name, {@code gcloud-java}, as a string.
@@ -671,24 +553,12 @@ static T newInstance(String className) throws IOException, ClassNotFoundExce
}
}
- @Deprecated
- protected ServiceFactory defaultServiceFactory() {
- return getDefaultServiceFactory();
- }
protected abstract ServiceFactory getDefaultServiceFactory();
- @Deprecated
- protected ServiceRpcFactory defaultRpcFactory() {
- return getDefaultRpcFactory();
- }
protected abstract ServiceRpcFactory getDefaultRpcFactory();
- @Deprecated
- protected Set scopes() {
- return getScopes();
- }
protected abstract Set getScopes();
diff --git a/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java b/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java
index 1938f819943f..a84b25bc369b 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java
@@ -60,13 +60,6 @@ private CheckingPeriod(long period, TimeUnit unit) {
this.unit = unit;
}
- /**
- * Returns the checking period.
- */
- @Deprecated
- public long period() {
- return getPeriod();
- }
/**
* Returns the checking period.
@@ -75,13 +68,6 @@ public long getPeriod() {
return period;
}
- /**
- * Returns the time unit for {@link #getPeriod()}.
- */
- @Deprecated
- public TimeUnit unit() {
- return getUnit();
- }
/**
* Returns the time unit for {@link #getPeriod()}.
@@ -152,13 +138,6 @@ private Timeout(long timeoutMillis) {
this.timeoutMillis = timeoutMillis;
}
- /**
- * Returns the timeout in milliseconds.
- */
- @Deprecated
- public long timeoutMillis() {
- return getTimeoutMillis();
- }
/**
* Returns the timeout in milliseconds.
diff --git a/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java b/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java
index f061f55ac581..172e4b03bfdb 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java
@@ -29,12 +29,6 @@
*/
public interface WriteChannel extends WritableByteChannel, Closeable, Restorable {
- /**
- * Sets the minimum size that will be written by a single RPC.
- * Written data will be buffered and only flushed upon reaching this size or closing the channel.
- */
- @Deprecated
- void chunkSize(int chunkSize);
/**
* Sets the minimum size that will be written by a single RPC.
diff --git a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
index 0767d205ecc1..1f6298857ab0 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
@@ -50,11 +50,6 @@ private static class TestPageFetcher implements AsyncPageImpl.NextPageFetcher> nextPage() {
- return getNextPage();
- }
-
@Override
public Future> getNextPage() {
return Futures.>immediateFuture(nextResult);
@@ -71,15 +66,6 @@ public void testPage() {
assertEquals(VALUES1, result.getValues());
}
- @Test
- public void testPageDeprecated() {
- final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2);
- AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult);
- AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1);
- assertEquals(nextResult, result.nextPage());
- assertEquals("c", result.nextPageCursor());
- assertEquals(VALUES1, result.values());
- }
@Test
public void testPageAsync() throws ExecutionException, InterruptedException {
@@ -91,15 +77,6 @@ public void testPageAsync() throws ExecutionException, InterruptedException {
assertEquals(VALUES1, result.getValues());
}
- @Test
- public void testPageAsyncDeprecated() throws ExecutionException, InterruptedException {
- final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2);
- AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult);
- AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1);
- assertEquals(nextResult, result.nextPageAsync().get());
- assertEquals("c", result.nextPageCursor());
- assertEquals(VALUES1, result.values());
- }
@Test
public void testIterateAll() {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
index 8980643b32c9..9ac4b4b9894d 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
@@ -150,94 +150,6 @@ public void testBaseServiceException() {
assertEquals(IDEMPOTENT, serviceException.isIdempotent());
}
- @Test
- public void testBaseServiceExceptionDeprecated() {
- BaseServiceException serviceException = new BaseServiceException(CODE, MESSAGE, REASON,
- IDEMPOTENT);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertFalse(serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
- assertNull(serviceException.getCause());
-
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertFalse(serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
- assertNull(serviceException.getCause());
-
- Exception cause = new RuntimeException();
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, cause);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertFalse(serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
- assertEquals(cause, serviceException.getCause());
-
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, false, cause);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertFalse(serviceException.retryable());
- assertFalse(serviceException.idempotent());
- assertEquals(cause, serviceException.getCause());
-
- IOException exception = new SocketTimeoutException();
- serviceException = new BaseServiceException(exception, true);
- assertTrue(serviceException.retryable());
- assertTrue(serviceException.idempotent());
- assertNull(serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- exception = new SocketException();
- serviceException = new BaseServiceException(exception, true);
- assertTrue(serviceException.retryable());
- assertTrue(serviceException.idempotent());
- assertNull(serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- exception = new IOException("insufficient data written");
- serviceException = new BaseServiceException(exception, true);
- assertTrue(serviceException.retryable());
- assertTrue(serviceException.idempotent());
- assertEquals("insufficient data written", serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- GoogleJsonError error = new GoogleJsonError();
- error.setCode(CODE);
- error.setMessage(MESSAGE);
- serviceException = new BaseServiceException(error, true);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertFalse(serviceException.retryable());
- assertTrue(serviceException.idempotent());
-
- serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
- assertEquals(CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertEquals(RETRYABLE, serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
-
- serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT);
- assertEquals(CODE_NO_REASON, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertNull(serviceException.reason());
- assertEquals(RETRYABLE, serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
-
- serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT);
- assertEquals(UNKNOWN_CODE, serviceException.code());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.reason());
- assertEquals(RETRYABLE, serviceException.retryable());
- assertEquals(IDEMPOTENT, serviceException.idempotent());
- }
-
@Test
public void testTranslateAndThrow() throws Exception {
BaseServiceException cause = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
diff --git a/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java b/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java
index 9fb58a1633d9..a5c278a83254 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java
@@ -93,17 +93,6 @@ public void testConstructor() {
assertEquals(DEFAULT_CHUNK_SIZE, channel.getChunkSize());
}
- @Test
- public void testConstructorDeprecated() {
- assertEquals(null, channel.options());
- assertEquals(ENTITY, channel.entity());
- assertEquals(0, channel.position());
- assertEquals(UPLOAD_ID, channel.uploadId());
- assertEquals(0, channel.limit());
- assertTrue(channel.isOpen());
- assertArrayEquals(new byte[0], channel.buffer());
- assertEquals(DEFAULT_CHUNK_SIZE, channel.chunkSize());
- }
@Test
public void testClose() throws IOException {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java b/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java
index 408dc731324a..d95200a1c7b6 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java
@@ -29,33 +29,18 @@
public class FieldSelectorHelperTest {
private static final FieldSelector FIELD1 = new FieldSelector() {
- @Override
- public String selector() {
- return getSelector();
- }
-
@Override
public String getSelector() {
return "field1";
}
};
private static final FieldSelector FIELD2 = new FieldSelector() {
- @Override
- public String selector() {
- return getSelector();
- }
-
@Override
public String getSelector() {
return "field2";
}
};
private static final FieldSelector FIELD3 = new FieldSelector() {
- @Override
- public String selector() {
- return getSelector();
- }
-
@Override
public String getSelector() {
return "field3";
diff --git a/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java
index f0906fae03b2..a5c7cebfc4aa 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java
@@ -43,18 +43,8 @@ public class GrpcServiceOptionsTest {
.setMaxTimeout(5678)
.setExecutorFactory(MOCK_EXECUTOR_FACTORY)
.build();
- private static final TestGrpcServiceOptions DEPRECATED_OPTIONS =
- TestGrpcServiceOptions.newBuilder()
- .projectId("project-id")
- .initialTimeout(1234)
- .timeoutMultiplier(1.6)
- .maxTimeout(5678)
- .executorFactory(MOCK_EXECUTOR_FACTORY)
- .build();
private static final TestGrpcServiceOptions DEFAULT_OPTIONS =
TestGrpcServiceOptions.newBuilder().setProjectId("project-id").build();
- private static final TestGrpcServiceOptions DEPRECATED_DEFAULT_OPTIONS =
- TestGrpcServiceOptions.newBuilder().projectId("project-id").build();
private static final TestGrpcServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build();
private interface TestService extends Service {}
@@ -164,18 +154,6 @@ public void testBuilder() {
assertTrue(DEFAULT_OPTIONS.getExecutorFactory() instanceof DefaultExecutorFactory);
}
- @Test
- public void testBuilderDeprecated() {
- assertEquals(1234, DEPRECATED_OPTIONS.initialTimeout());
- assertEquals(1.6, DEPRECATED_OPTIONS.timeoutMultiplier(), 0.0);
- assertEquals(5678, DEPRECATED_OPTIONS.maxTimeout());
- assertSame(MOCK_EXECUTOR_FACTORY, DEPRECATED_OPTIONS.executorFactory());
- assertEquals(20000, DEPRECATED_DEFAULT_OPTIONS.initialTimeout());
- assertEquals(1.5, DEPRECATED_DEFAULT_OPTIONS.timeoutMultiplier(), 0.0);
- assertEquals(100000, DEPRECATED_DEFAULT_OPTIONS.maxTimeout());
- assertTrue(DEPRECATED_DEFAULT_OPTIONS.executorFactory() instanceof DefaultExecutorFactory);
- }
-
@Test
public void testBuilderError() {
try {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java
index 9ac2891c6cbf..81e330236c8b 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java
@@ -40,17 +40,8 @@ public class HttpServiceOptionsTest {
.setHttpTransportFactory(MOCK_HTTP_TRANSPORT_FACTORY)
.setReadTimeout(5678)
.build();
- private static final TestHttpServiceOptions DEPRECATED_OPTIONS =
- TestHttpServiceOptions.newBuilder()
- .projectId("project-id")
- .connectTimeout(1234)
- .httpTransportFactory(MOCK_HTTP_TRANSPORT_FACTORY)
- .readTimeout(5678)
- .build();
private static final TestHttpServiceOptions DEFAULT_OPTIONS =
TestHttpServiceOptions.newBuilder().setProjectId("project-id").build();
- private static final TestHttpServiceOptions DEPRECATED_DEFAULT_OPTIONS =
- TestHttpServiceOptions.newBuilder().projectId("project-id").build();
private static final TestHttpServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build();
private interface TestService extends Service {}
@@ -158,17 +149,6 @@ public void testBuilder() {
assertEquals(-1, DEFAULT_OPTIONS.getReadTimeout());
}
- @Test
- public void testBuilderDeprecated() {
- assertEquals(1234, DEPRECATED_OPTIONS.connectTimeout());
- assertSame(MOCK_HTTP_TRANSPORT_FACTORY, DEPRECATED_OPTIONS.httpTransportFactory());
- assertEquals(5678, DEPRECATED_OPTIONS.readTimeout());
- assertEquals(-1, DEPRECATED_DEFAULT_OPTIONS.connectTimeout());
- assertTrue(
- DEPRECATED_DEFAULT_OPTIONS.httpTransportFactory() instanceof DefaultHttpTransportFactory);
- assertEquals(-1, DEPRECATED_DEFAULT_OPTIONS.readTimeout());
- }
-
@Test
public void testBaseEquals() {
assertEquals(OPTIONS, OPTIONS_COPY);
diff --git a/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java b/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java
index 5a80daa50da4..b7b244adb9db 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java
@@ -37,11 +37,6 @@ public void testAllUsers() {
assertNull(ALL_USERS.getValue());
}
- @Test
- public void testAllUsersDeprecated() {
- assertEquals(Identity.Type.ALL_USERS, ALL_USERS.type());
- assertNull(ALL_USERS.value());
- }
@Test
public void testAllAuthenticatedUsers() {
@@ -49,11 +44,6 @@ public void testAllAuthenticatedUsers() {
assertNull(ALL_AUTH_USERS.getValue());
}
- @Test
- public void testAllAuthenticatedUsersDeprecated() {
- assertEquals(Identity.Type.ALL_AUTHENTICATED_USERS, ALL_AUTH_USERS.type());
- assertNull(ALL_AUTH_USERS.value());
- }
@Test
public void testUser() {
@@ -61,11 +51,6 @@ public void testUser() {
assertEquals("abc@gmail.com", USER.getValue());
}
- @Test
- public void testUserDeprecated() {
- assertEquals(Identity.Type.USER, USER.type());
- assertEquals("abc@gmail.com", USER.value());
- }
@Test(expected = NullPointerException.class)
public void testUserNullEmail() {
@@ -78,11 +63,6 @@ public void testServiceAccount() {
assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.getValue());
}
- @Test
- public void testServiceAccountDeprecated() {
- assertEquals(Identity.Type.SERVICE_ACCOUNT, SERVICE_ACCOUNT.type());
- assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.value());
- }
@Test(expected = NullPointerException.class)
public void testServiceAccountNullEmail() {
@@ -95,11 +75,6 @@ public void testGroup() {
assertEquals("group@gmail.com", GROUP.getValue());
}
- @Test
- public void testGroupDeprecated() {
- assertEquals(Identity.Type.GROUP, GROUP.type());
- assertEquals("group@gmail.com", GROUP.value());
- }
@Test(expected = NullPointerException.class)
public void testGroupNullEmail() {
@@ -112,11 +87,6 @@ public void testDomain() {
assertEquals("google.com", DOMAIN.getValue());
}
- @Test
- public void testDomainDeprecated() {
- assertEquals(Identity.Type.DOMAIN, DOMAIN.type());
- assertEquals("google.com", DOMAIN.value());
- }
@Test(expected = NullPointerException.class)
public void testDomainNullId() {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java
index 24a8be62e760..e380eab47133 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java
@@ -67,21 +67,6 @@ public void testLabelDescriptor() {
assertNull(INT_LABEL_NO_DESCRIPTION.getDescription());
}
- @Test
- public void testLabelDescriptorDeprecated() {
- assertEquals("booleanKey", BOOLEAN_LABEL.key());
- assertEquals(ValueType.BOOL, BOOLEAN_LABEL.valueType());
- assertEquals("Boolean label", BOOLEAN_LABEL.description());
- assertEquals("stringKey", STRING_LABEL.key());
- assertEquals(ValueType.STRING, STRING_LABEL.valueType());
- assertEquals("String label", STRING_LABEL.description());
- assertEquals("intKey", INT_LABEL.key());
- assertEquals(ValueType.INT64, INT_LABEL.valueType());
- assertEquals("Int label", INT_LABEL.description());
- assertEquals("intKey", INT_LABEL_NO_DESCRIPTION.key());
- assertEquals(ValueType.INT64, INT_LABEL_NO_DESCRIPTION.valueType());
- assertNull(INT_LABEL_NO_DESCRIPTION.description());
- }
@Test
public void testBuilder() {
@@ -99,21 +84,6 @@ public void testBuilder() {
assertEquals(ImmutableList.of(), resourceDescriptor.getLabels());
}
- @Test
- public void testBuilderDeprecated() {
- assertEquals(TYPE, RESOURCE_DESCRIPTOR.type());
- assertEquals(NAME, RESOURCE_DESCRIPTOR.name());
- assertEquals(DISPLAY_NAME, RESOURCE_DESCRIPTOR.displayName());
- assertEquals(DESCRIPTION, RESOURCE_DESCRIPTOR.description());
- assertEquals(LABELS, RESOURCE_DESCRIPTOR.labels());
- MonitoredResourceDescriptor resourceDescriptor =
- MonitoredResourceDescriptor.newBuilder(TYPE).build();
- assertEquals(TYPE, resourceDescriptor.type());
- assertNull(resourceDescriptor.name());
- assertNull(resourceDescriptor.displayName());
- assertNull(resourceDescriptor.description());
- assertEquals(ImmutableList.of(), resourceDescriptor.labels());
- }
@Test
public void testToAndFromPbLabelDescriptor() {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java
index 845ff035c679..324ed740e433 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java
@@ -32,10 +32,6 @@ public class MonitoredResourceTest {
private static final MonitoredResource MONITORED_RESOURCE = MonitoredResource.newBuilder(TYPE)
.setLabels(LABELS)
.build();
- private static final MonitoredResource DEPRECATED_MONITORED_RESOURCE =
- MonitoredResource.builder(TYPE)
- .labels(LABELS)
- .build();
@Test
public void testBuilder() {
@@ -58,26 +54,6 @@ public void testBuilder() {
assertEquals(ImmutableMap.of(), monitoredResource.getLabels());
}
- @Test
- public void testBuilderDeprecated() {
- assertEquals(TYPE, DEPRECATED_MONITORED_RESOURCE.type());
- assertEquals(LABELS, DEPRECATED_MONITORED_RESOURCE.labels());
- MonitoredResource monitoredResource = MonitoredResource.builder(TYPE)
- .addLabel("dataset-id", "myDataset")
- .addLabel("zone", "myZone")
- .build();
- assertEquals(TYPE, monitoredResource.type());
- assertEquals(LABELS, monitoredResource.labels());
- compareMonitoredResource(DEPRECATED_MONITORED_RESOURCE, monitoredResource);
- monitoredResource = MonitoredResource.builder(TYPE)
- .type("global")
- .addLabel("dataset-id", "myDataset")
- .addLabel("zone", "myZone")
- .clearLabels()
- .build();
- assertEquals("global", monitoredResource.type());
- assertEquals(ImmutableMap.of(), monitoredResource.labels());
- }
@Test
public void testToBuilder() {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
index 2a70b07ac949..fb1d2c209cc2 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
@@ -40,11 +40,6 @@ private static class TestPageFetcher implements PageImpl.NextPageFetcher
this.nextResult = nextResult;
}
- @Override
- public Page nextPage() {
- return getNextPage();
- }
-
@Override
public Page getNextPage() {
return nextResult;
@@ -61,15 +56,6 @@ public void testPage() {
assertEquals(VALUES, result.getValues());
}
- @Test
- public void testPageDeprecated() {
- final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES);
- PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult);
- PageImpl result = new PageImpl<>(fetcher, "c", VALUES);
- assertEquals(nextResult, result.nextPage());
- assertEquals("c", result.nextPageCursor());
- assertEquals(VALUES, result.values());
- }
@Test
public void testIterateAll() {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java b/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java
index 29583e64827a..cc334ec73271 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java
@@ -55,20 +55,11 @@ public class PolicyTest {
.addIdentity(VIEWER, USER, SERVICE_ACCOUNT, ALL_USERS)
.addIdentity(EDITOR, ALL_AUTH_USERS, GROUP, DOMAIN)
.build();
- private static final Policy DEPRECATED_SIMPLE_POLICY = Policy.builder()
- .addIdentity(VIEWER, USER, SERVICE_ACCOUNT, ALL_USERS)
- .addIdentity(EDITOR, ALL_AUTH_USERS, GROUP, DOMAIN)
- .build();
private static final Policy FULL_POLICY = Policy.newBuilder()
.setBindings(SIMPLE_POLICY.getBindings())
.setEtag("etag")
.setVersion(1)
.build();
- private static final Policy DEPRECATED_FULL_POLICY = Policy.builder()
- .bindings(SIMPLE_POLICY.getBindings())
- .etag("etag")
- .version(1)
- .build();
@Test
public void testBuilder() {
@@ -108,43 +99,6 @@ public void testBuilder() {
assertEquals(0, policy.getVersion());
}
- @Test
- public void testBuilderDeprecated() {
- assertEquals(BINDINGS, DEPRECATED_SIMPLE_POLICY.bindings());
- assertEquals(null, DEPRECATED_SIMPLE_POLICY.etag());
- assertEquals(0, DEPRECATED_SIMPLE_POLICY.version());
- assertEquals(BINDINGS, DEPRECATED_FULL_POLICY.bindings());
- assertEquals("etag", DEPRECATED_FULL_POLICY.etag());
- assertEquals(1, DEPRECATED_FULL_POLICY.version());
- Map> editorBinding =
- ImmutableMap.>builder().put(EDITOR, BINDINGS.get(EDITOR)).build();
- Policy policy = DEPRECATED_FULL_POLICY.toBuilder().bindings(editorBinding).build();
- assertEquals(editorBinding, policy.bindings());
- assertEquals("etag", policy.etag());
- assertEquals(1, policy.version());
- policy = DEPRECATED_SIMPLE_POLICY.toBuilder().removeRole(EDITOR).build();
- assertEquals(ImmutableMap.of(VIEWER, BINDINGS.get(VIEWER)), policy.bindings());
- assertNull(policy.etag());
- assertEquals(0, policy.version());
- policy = policy.toBuilder()
- .removeIdentity(VIEWER, USER, ALL_USERS)
- .addIdentity(VIEWER, DOMAIN, GROUP)
- .build();
- assertEquals(ImmutableMap.of(VIEWER, ImmutableSet.of(SERVICE_ACCOUNT, DOMAIN, GROUP)),
- policy.bindings());
- assertNull(policy.etag());
- assertEquals(0, policy.version());
- policy = Policy.builder()
- .removeIdentity(VIEWER, USER)
- .addIdentity(OWNER, USER, SERVICE_ACCOUNT)
- .addIdentity(EDITOR, GROUP)
- .removeIdentity(EDITOR, GROUP)
- .build();
- assertEquals(ImmutableMap.of(OWNER, ImmutableSet.of(USER, SERVICE_ACCOUNT)), policy.bindings());
- assertNull(policy.etag());
- assertEquals(0, policy.version());
- }
-
@Test
public void testIllegalPolicies() {
try {
diff --git a/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java b/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java
index 987cf1daa144..68bb7ce35316 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java
@@ -101,51 +101,6 @@ public void testTriesWithExceptionHandling() {
assertNull(RetryHelper.getContext());
}
- @Test
- public void testTriesWithExceptionHandlingDeprecated() {
- assertNull(RetryHelper.getContext());
- RetryParams params =
- RetryParams.builder().initialRetryDelayMillis(0).retryMaxAttempts(3).build();
- ExceptionHandler handler = ExceptionHandler.builder()
- .retryOn(IOException.class).abortOn(RuntimeException.class).build();
- final AtomicInteger count = new AtomicInteger(3);
- try {
- RetryHelper.runWithRetries(new Callable