Skip to content
Permalink
Browse files
docs(samples): update UpdateTableExpirationIT to fix failing IT. (#1753)
  • Loading branch information
stephaniewang526 committed Dec 16, 2021
1 parent 22a9e4c commit a62a9f4fdda465b8c9e2f67f111d1b1b4a067903
Showing with 4 additions and 2 deletions.
  1. +4 −2 samples/snippets/src/test/java/com/example/bigquery/UpdateTableExpirationIT.java
@@ -24,8 +24,9 @@
import com.google.cloud.bigquery.StandardSQLTypeName;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
@@ -81,7 +82,8 @@ public void tearDown() {

@Test
public void testUpdateTableExpiration() {
Long newExpiration = TimeUnit.MILLISECONDS.convert(1, TimeUnit.DAYS);
// Set new expiration to a week from Now
Long newExpiration = Instant.now().plus(7, ChronoUnit.DAYS).toEpochMilli();
UpdateTableExpiration.updateTableExpiration(BIGQUERY_DATASET_NAME, tableName, newExpiration);
assertThat(bout.toString()).contains("Table expiration updated successfully");
}

0 comments on commit a62a9f4

Please sign in to comment.