File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
samples/snippets/src/test/java/com/example/bigquery Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 24
24
import com .google .cloud .bigquery .StandardSQLTypeName ;
25
25
import java .io .ByteArrayOutputStream ;
26
26
import java .io .PrintStream ;
27
+ import java .time .Instant ;
28
+ import java .time .temporal .ChronoUnit ;
27
29
import java .util .UUID ;
28
- import java .util .concurrent .TimeUnit ;
29
30
import java .util .logging .Level ;
30
31
import java .util .logging .Logger ;
31
32
import org .junit .After ;
@@ -81,7 +82,8 @@ public void tearDown() {
81
82
82
83
@ Test
83
84
public void testUpdateTableExpiration () {
84
- Long newExpiration = TimeUnit .MILLISECONDS .convert (1 , TimeUnit .DAYS );
85
+ // Set new expiration to a week from Now
86
+ Long newExpiration = Instant .now ().plus (7 , ChronoUnit .DAYS ).toEpochMilli ();
85
87
UpdateTableExpiration .updateTableExpiration (BIGQUERY_DATASET_NAME , tableName , newExpiration );
86
88
assertThat (bout .toString ()).contains ("Table expiration updated successfully" );
87
89
}
You can’t perform that action at this time.
0 commit comments