Skip to content
Permalink
Browse files
fix: remove dependency on commons-lang (#494)
* remove dependency on commons-lang
  • Loading branch information
elharo committed Oct 3, 2020
1 parent 2a95ef6 commit c99294beb43ce1bd67cc3d12e4104641efab6710
@@ -237,22 +237,15 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>

<!-- Test dependencies -->
<dependency>
@@ -34,12 +34,12 @@
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import org.apache.commons.lang3.ArrayUtils;

/**
* {@link UnitOfWork} that is used when a DDL batch is started. These batches only accept DDL
@@ -124,7 +124,10 @@ public ResultSet executeQuery(
// Queries marked with internal metadata queries are allowed during a DDL batch.
// These can only be generated by library internal methods and may be used to check
// whether a database object such as table or an index exists.
final QueryOption[] internalOptions = ArrayUtils.remove(options, i);
List<QueryOption> temp = new ArrayList<>();
Collections.addAll(temp, options);
temp.remove(i);
final QueryOption[] internalOptions = temp.toArray(new QueryOption[0]);
Callable<ResultSet> callable =
new Callable<ResultSet>() {
@Override
@@ -156,11 +156,9 @@ public void testExecuteMetadataQuery() {
when(singleUse.executeQuery(statement)).thenReturn(resultSet);
when(dbClient.singleUse()).thenReturn(singleUse);
DdlBatch batch = createSubject(createDefaultMockDdlClient(), dbClient);
assertThat(
batch
.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE)
.hashCode(),
is(equalTo(resultSet.hashCode())));
ResultSet result =
batch.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE);
assertThat(result.hashCode(), is(equalTo(resultSet.hashCode())));
}

@Test

0 comments on commit c99294b

Please sign in to comment.