File tree
Expand file treeCollapse file tree3 files changed
+8
-14
lines changed main/java/com/google/cloud/spanner/connection test/java/com/google/cloud/spanner/connection
Expand file treeCollapse file tree3 files changed
+8
-14
lines changed Original file line number | Diff line number | Diff line change |
---|
|
237 | 237 | <dependency>
|
238 | 238 | <groupId>com.google.code.findbugs</groupId>
|
239 | 239 | <artifactId>jsr305</artifactId>
|
240 |
| -<version>3.0.2</version> |
241 | 240 | </dependency>
|
242 | 241 | <dependency>
|
243 | 242 | <groupId>com.google.code.gson</groupId>
|
244 | 243 | <artifactId>gson</artifactId>
|
245 |
| -<version>2.8.6</version> |
246 | 244 | </dependency>
|
247 | 245 | <dependency>
|
248 | 246 | <groupId>com.google.auth</groupId>
|
249 | 247 | <artifactId>google-auth-library-credentials</artifactId>
|
250 | 248 | </dependency>
|
251 |
| -<dependency> |
252 |
| -<groupId>org.apache.commons</groupId> |
253 |
| -<artifactId>commons-lang3</artifactId> |
254 |
| -<version>3.5</version> |
255 |
| -</dependency> |
256 | 249 |
|
257 | 250 | <!-- Test dependencies -->
|
258 | 251 | <dependency>
|
|
Original file line number | Diff line number | Diff line change |
---|
|
34 | 34 | import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
|
35 | 35 | import java.util.ArrayList;
|
36 | 36 | import java.util.Arrays;
|
| 37 | +import java.util.Collections; |
37 | 38 | import java.util.HashSet;
|
38 | 39 | import java.util.List;
|
39 | 40 | import java.util.Set;
|
40 | 41 | import java.util.concurrent.Callable;
|
41 | 42 | import java.util.concurrent.ExecutionException;
|
42 |
| -import org.apache.commons.lang3.ArrayUtils; |
43 | 43 |
|
44 | 44 | /**
|
45 | 45 | * {@link UnitOfWork} that is used when a DDL batch is started. These batches only accept DDL
|
@@ -124,7 +124,10 @@ public ResultSet executeQuery(
|
124 | 124 | // Queries marked with internal metadata queries are allowed during a DDL batch.
|
125 | 125 | // These can only be generated by library internal methods and may be used to check
|
126 | 126 | // whether a database object such as table or an index exists.
|
127 |
| -final QueryOption[] internalOptions = ArrayUtils.remove(options, i); |
| 127 | +List<QueryOption> temp = new ArrayList<>(); |
| 128 | +Collections.addAll(temp, options); |
| 129 | +temp.remove(i); |
| 130 | +final QueryOption[] internalOptions = temp.toArray(new QueryOption[0]); |
128 | 131 | Callable<ResultSet> callable =
|
129 | 132 | new Callable<ResultSet>() {
|
130 | 133 | @Override
|
|
Original file line number | Diff line number | Diff line change |
---|
@@ -156,11 +156,9 @@ public void testExecuteMetadataQuery() {
|
156 | 156 | when(singleUse.executeQuery(statement)).thenReturn(resultSet);
|
157 | 157 | when(dbClient.singleUse()).thenReturn(singleUse);
|
158 | 158 | DdlBatch batch = createSubject(createDefaultMockDdlClient(), dbClient);
|
159 |
| -assertThat( |
160 |
| -batch |
161 |
| -.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE) |
162 |
| -.hashCode(), |
163 |
| -is(equalTo(resultSet.hashCode()))); |
| 159 | +ResultSet result = |
| 160 | +batch.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE); |
| 161 | +assertThat(result.hashCode(), is(equalTo(resultSet.hashCode()))); |
164 | 162 | }
|
165 | 163 |
|
166 | 164 | @Test
|
|
You can’t perform that action at this time.
0 commit comments