It is important to stop the emulator. Since the emulator runs in its own process, not * stopping it might cause it to become orphan. @@ -335,7 +345,7 @@ public void stop(Duration timeout) throws IOException, InterruptedException, Tim *
It is not required to call {@link #reset()} before {@code stop()}.
*/
public void stop() throws IOException, InterruptedException, TimeoutException {
- stop(Duration.ofSeconds(20));
+ stopDuration(java.time.Duration.ofSeconds(20));
}
static void deleteRecursively(Path path) throws IOException {
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreTest.java
index d88e1d1ec..459278f25 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreTest.java
@@ -68,6 +68,7 @@
import com.google.datastore.v1.TransactionOptions;
import com.google.protobuf.ByteString;
import java.io.IOException;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -87,7 +88,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import org.threeten.bp.Duration;
@RunWith(JUnit4.class)
public class DatastoreTest {
@@ -193,7 +193,7 @@ public void setUp() {
@AfterClass
public static void afterClass() throws IOException, InterruptedException, TimeoutException {
- helper.stop(Duration.ofMinutes(1));
+ helper.stopDuration(Duration.ofMinutes(1));
}
@Test
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java
index c012d28c9..bf0c20dce 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java
@@ -81,6 +81,7 @@
import com.google.common.truth.Truth;
import com.google.datastore.v1.TransactionOptions;
import com.google.datastore.v1.TransactionOptions.ReadOnly;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -103,7 +104,6 @@
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.threeten.bp.Duration;
@RunWith(Parameterized.class)
public class ITDatastoreTest {
@@ -674,7 +674,7 @@ private void assertExecutionStats(
Truth.assertThat(debugStats.get("index_entries_scanned"))
.isEqualTo(expectedIndexEntriesScanned);
- Duration executionDuration = executionStats.getExecutionDuration();
+ Duration executionDuration = executionStats.getExecutionDurationJavaTime();
Truth.assertThat(executionDuration).isIn(Range.greaterThan(Duration.ofMillis(0)));
long readOperations = executionStats.getReadOperations();
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/models/ExecutionStatsTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/models/ExecutionStatsTest.java
index 4706e3b86..a0e778cee 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/models/ExecutionStatsTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/models/ExecutionStatsTest.java
@@ -41,8 +41,8 @@ public class ExecutionStatsTest {
@Test
public void testModel() {
Truth.assertThat(executionStats.getDebugStats()).isEqualTo(Structs.asMap(struct));
- Truth.assertThat(executionStats.getExecutionDuration())
- .isEqualTo(org.threeten.bp.Duration.ofNanos(duration.getNanos()));
+ Truth.assertThat(executionStats.getExecutionDurationJavaTime())
+ .isEqualTo(java.time.Duration.ofNanos(duration.getNanos()));
Truth.assertThat(executionStats.getReadOperations()).isEqualTo(2);
Truth.assertThat(executionStats.getResultsReturned()).isEqualTo(3);
}
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/ITLocalDatastoreHelperTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/ITLocalDatastoreHelperTest.java
index 3ebd3ef4a..dfa2255a0 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/ITLocalDatastoreHelperTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/ITLocalDatastoreHelperTest.java
@@ -32,6 +32,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.time.Duration;
import java.util.concurrent.TimeoutException;
import org.junit.After;
import org.junit.Assert;
@@ -39,7 +40,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import org.threeten.bp.Duration;
@RunWith(JUnit4.class)
public class ITLocalDatastoreHelperTest {
@@ -178,7 +178,7 @@ public void testStartStopReset() throws IOException, InterruptedException, Timeo
assertNotNull(datastore.get(key));
helper.reset();
assertNull(datastore.get(key));
- helper.stop(Duration.ofMinutes(1));
+ helper.stopDuration(Duration.ofMinutes(1));
datastore.get(key);
Assert.fail();
} catch (DatastoreException ex) {
@@ -198,7 +198,7 @@ public void testStartStopResetWithBuilder()
assertNotNull(datastore.get(key));
helper.reset();
assertNull(datastore.get(key));
- helper.stop(Duration.ofMinutes(1));
+ helper.stopDuration(Duration.ofMinutes(1));
datastore.get(key);
Assert.fail();
} catch (DatastoreException ex) {
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
index 6167cedca..a4b389a1e 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
@@ -27,9 +27,9 @@
import com.google.cloud.datastore.StructuredQuery;
import com.google.cloud.http.HttpTransportOptions;
import io.opentelemetry.sdk.OpenTelemetrySdk;
+import java.time.Duration;
import java.util.UUID;
import javax.annotation.Nullable;
-import org.threeten.bp.Duration;
/**
* Utility to create a remote datastore configuration for testing. Datastore options can be obtained
@@ -110,13 +110,13 @@ public static RemoteDatastoreHelper create(String databaseId) {
private static RetrySettings retrySettings() {
return RetrySettings.newBuilder()
.setMaxAttempts(10)
- .setMaxRetryDelay(Duration.ofMillis(30000L))
- .setTotalTimeout(Duration.ofMillis(120000L))
- .setInitialRetryDelay(Duration.ofMillis(250L))
+ .setMaxRetryDelayDuration(Duration.ofMillis(30000L))
+ .setTotalTimeoutDuration(Duration.ofMillis(120000L))
+ .setInitialRetryDelayDuration(Duration.ofMillis(250L))
.setRetryDelayMultiplier(1.0)
- .setInitialRpcTimeout(Duration.ofMillis(120000L))
+ .setInitialRpcTimeoutDuration(Duration.ofMillis(120000L))
.setRpcTimeoutMultiplier(1.0)
- .setMaxRpcTimeout(Duration.ofMillis(120000L))
+ .setMaxRpcTimeoutDuration(Duration.ofMillis(120000L))
.build();
}
}
diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml
index bc6da09a2..46a6065ba 100644
--- a/grpc-google-cloud-datastore-admin-v1/pom.xml
+++ b/grpc-google-cloud-datastore-admin-v1/pom.xml
@@ -4,13 +4,13 @@