Skip to content

Commit

Permalink
fix: adapt toString tests to introduction of java.time in gax (#2274)
Browse files Browse the repository at this point in the history
* fix: adapt `toString` tests to introduction of java.time in gax

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* deps: update shared dependencies

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Lawrence Qiu <lawrenceqiu@google.com>
  • Loading branch information
4 people authored Aug 6, 2024
1 parent ec7b322 commit 93f66a7
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
shell: bash
run: .kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.32.0
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.33.0
with:
bom-path: google-cloud-bigtable-bom/pom.xml
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.32.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.32.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-bigtable-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.32.0</version>
<version>3.33.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions google-cloud-bigtable-deps-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.32.0</version>
<version>3.33.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gapic-libraries-bom</artifactId>
<version>1.40.0</version>
<version>1.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void testToString() throws IOException {
BigtableInstanceAdminSettings settings = builder.build();
checkToString(settings);
assertThat(settings.toString()).contains("endpoint=example.com:1234");
assertThat(settings.toString()).contains("totalTimeout=PT13H32M");
assertThat(settings.toString()).contains("totalTimeoutDuration=PT13H32M");
}

void checkToString(BigtableInstanceAdminSettings settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public void testToString() throws IOException {
checkToString(settings);
assertThat(defaultSettings.toString()).doesNotContain("endpoint=example.com:1234");
assertThat(settings.toString()).contains("endpoint=example.com:1234");
assertThat(defaultSettings.toString()).doesNotContain("totalTimeout=PT13H32M");
assertThat(settings.toString()).contains("totalTimeout=PT13H32M");
assertThat(defaultSettings.toString()).doesNotContain("totalTimeoutDuration=PT13H32M");
assertThat(settings.toString()).contains("totalTimeoutDuration=PT13H32M");

List<String> nonStaticFields =
Arrays.stream(BigtableTableAdminStubSettings.class.getDeclaredFields())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
import org.junit.runners.JUnit4;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.threeten.bp.Duration;

@RunWith(JUnit4.class)
public class BuiltinMetricsTracerTest {
Expand Down Expand Up @@ -232,7 +231,7 @@ public void sendMessage(ReqT message) {
stubSettingsBuilder
.mutateRowSettings()
.retrySettings()
.setInitialRetryDelay(Duration.ofMillis(200));
.setInitialRetryDelayDuration(java.time.Duration.ofMillis(200));

stubSettingsBuilder
.bulkMutateRowsSettings()
Expand All @@ -242,7 +241,7 @@ public void sendMessage(ReqT message) {
BatchingSettings.newBuilder()
.setElementCountThreshold((long) batchElementCount)
.setRequestByteThreshold(1000L)
.setDelayThreshold(Duration.ofHours(1))
.setDelayThresholdDuration(java.time.Duration.ofHours(1))
.setFlowControlSettings(
FlowControlSettings.newBuilder()
.setMaxOutstandingElementCount((long) batchElementCount + 1)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.32.0</version>
<version>3.33.0</version>
<relativePath/>
</parent>

Expand Down

0 comments on commit 93f66a7

Please sign in to comment.