Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 34af06b

Browse files
committed
chore: Remove the deprecated v1beta2 Write API tests
1 parent 9a781cf commit 34af06b

17 files changed

Lines changed: 9 additions & 4584 deletions

google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/it/ITBigQueryStorageLongRunningTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.concurrent.ExecutorService;
3737
import java.util.concurrent.Executors;
3838
import java.util.concurrent.Future;
39+
import java.util.concurrent.TimeUnit;
3940
import java.util.logging.Logger;
4041
import org.junit.AfterClass;
4142
import org.junit.Assume;
@@ -78,9 +79,10 @@ public static void beforeClass() throws IOException {
7879
}
7980

8081
@AfterClass
81-
public static void afterClass() {
82+
public static void afterClass() throws InterruptedException {
8283
if (client != null) {
8384
client.close();
85+
client.awaitTermination(10, TimeUnit.SECONDS);
8486
}
8587
}
8688

@@ -111,17 +113,12 @@ public void testLongRunningReadSession() throws InterruptedException, ExecutionE
111113

112114
List<Callable<Long>> tasks = new ArrayList<>(session.getStreamsCount());
113115
for (final Stream stream : session.getStreamsList()) {
114-
tasks.add(
115-
new Callable<Long>() {
116-
@Override
117-
public Long call() throws Exception {
118-
return readAllRowsFromStream(stream);
119-
}
120-
});
116+
tasks.add(() -> readAllRowsFromStream(stream));
121117
}
122118

123119
ExecutorService executor = Executors.newFixedThreadPool(tasks.size());
124120
List<Future<Long>> results = executor.invokeAll(tasks);
121+
executor.shutdown();
125122

126123
long rowCount = 0;
127124
for (Future<Long> result : results) {

google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/it/ITBigQueryStorageTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import java.util.Collections;
7979
import java.util.Iterator;
8080
import java.util.List;
81+
import java.util.concurrent.TimeUnit;
8182
import java.util.logging.Logger;
8283
import org.apache.avro.Conversions;
8384
import org.apache.avro.LogicalTypes;
@@ -199,9 +200,10 @@ public static void beforeClass() throws IOException {
199200
}
200201

201202
@AfterClass
202-
public static void afterClass() {
203+
public static void afterClass() throws InterruptedException {
203204
if (client != null) {
204205
client.close();
206+
client.awaitTermination(10, TimeUnit.SECONDS);
205207
}
206208

207209
if (bigquery != null) {
@@ -1318,8 +1320,7 @@ private Job RunQueryJobAndExpectSuccess(QueryJobConfiguration configuration)
13181320
}
13191321

13201322
static ServiceAccountCredentials loadCredentials(String credentialFile) {
1321-
try {
1322-
InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes());
1323+
try (InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes())) {
13231324
return ServiceAccountCredentials.fromStream(keyStream);
13241325
} catch (IOException e) {
13251326
fail("Couldn't create fake JSON credentials.");

0 commit comments

Comments
 (0)