Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<junixsocket.version>2.10.1</junixsocket.version>
<opentelemetry.exporter.version>0.36.0</opentelemetry.exporter.version>
<mockito.artifactId>mockito-core</mockito.artifactId>
<mockito.version>4.11.0</mockito.version>
</properties>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -252,8 +254,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<artifactId>${mockito.artifactId}</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -409,6 +411,16 @@
</plugins>
</build>
</profile>
<profile>
<id>mockito-jdk11plus</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<mockito.artifactId>mockito-subclass</mockito.artifactId>
<mockito.version>5.14.2</mockito.version>
</properties>
</profile>
</profiles>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
Expand Down Expand Up @@ -908,7 +906,7 @@ public void testListDatabasesOrInstances() {
Spanner spanner = mock(Spanner.class);
DatabaseAdminClient adminClient = mock(DatabaseAdminClient.class);
when(spanner.getDatabaseAdminClient()).thenReturn(adminClient);
when(adminClient.listDatabases(eq("my-instance"), any())).thenReturn(Pages.empty());
when(adminClient.listDatabases("my-instance")).thenReturn(Pages.empty());
StatusRuntimeException exception =
newStatusResourceNotFoundException(
"test-database",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4552,7 +4552,8 @@ public void testSetTimeZoneEST() throws SQLException {
try (Connection connection = DriverManager.getConnection(createUrl())) {
// Java considers 'EST' to always be '-05:00'. That is; it is never DST.
connection.createStatement().execute("set time zone 'EST'");
verifySettingValue(connection, "timezone", "-05:00");
verifySettingValue(
connection, "timezone", java.time.ZoneId.SHORT_IDS.getOrDefault("EST", "-05:00"));
// 'EST5EDT' is the ID for the timezone that will change with DST.
connection.createStatement().execute("set time zone 'EST5EDT'");
verifySettingValue(connection, "timezone", "EST5EDT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ public void testWriteMutations() throws Exception {
.set("name")
.to("Two")
.build());
verify(databaseClient).writeWithOptions(eq(expectedMutations), any());
verify(databaseClient)
.writeWithOptions(
eq(expectedMutations), any(com.google.cloud.spanner.Options.TransactionOption[].class));
}

@Test
Expand Down Expand Up @@ -270,7 +272,9 @@ public void testWriteMutations_NonAtomic_SucceedsForLargeBatch() throws Exceptio
StatementResult updateCount = mutationWriter.call();

assertEquals(5L, updateCount.getUpdateCount().longValue());
verify(databaseClient, times(3)).writeWithOptions(anyIterable(), any());
verify(databaseClient, times(3))
.writeWithOptions(
anyIterable(), any(com.google.cloud.spanner.Options.TransactionOption[].class));
} finally {
System.getProperties().remove("copy_in_mutation_limit");
}
Expand Down Expand Up @@ -372,7 +376,9 @@ public void testWriteMutations_NonAtomic_SucceedsForLargeCommit() throws Excepti
// 4. The second batch contains 28 bytes. (3 - 'Three')
// 5. The third batch contains 24 bytes. (4 - 'Four')
// 6. the fourth batch contains 24 bytes. (5 - 'Five')
verify(databaseClient, times(4)).writeWithOptions(anyIterable(), any());
verify(databaseClient, times(4))
.writeWithOptions(
anyIterable(), any(com.google.cloud.spanner.Options.TransactionOption[].class));
} finally {
System.getProperties().remove("copy_in_commit_limit");
}
Expand Down Expand Up @@ -441,7 +447,9 @@ public void testWritePartials() throws Exception {
.set("name")
.to("Five")
.build());
verify(databaseClient).writeWithOptions(eq(expectedMutations), any());
verify(databaseClient)
.writeWithOptions(
eq(expectedMutations), any(com.google.cloud.spanner.Options.TransactionOption[].class));

executor.shutdown();
}
Expand Down
Loading