|
48 | 48 | import com.google.cloud.bigquery.BigQuery.DatasetField; |
49 | 49 | import com.google.cloud.bigquery.BigQuery.DatasetListOption; |
50 | 50 | import com.google.cloud.bigquery.BigQuery.DatasetOption; |
| 51 | +import com.google.cloud.bigquery.BigQuery.DatasetUpdateMode; |
| 52 | +import com.google.cloud.bigquery.BigQuery.DatasetView; |
51 | 53 | import com.google.cloud.bigquery.BigQuery.JobField; |
52 | 54 | import com.google.cloud.bigquery.BigQuery.JobListOption; |
53 | 55 | import com.google.cloud.bigquery.BigQuery.JobOption; |
@@ -1236,18 +1238,20 @@ public void testGetDatasetWithAccessPolicyVersion() throws IOException { |
1236 | 1238 | "requests after the year 2024", |
1237 | 1239 | "location"); |
1238 | 1240 | Acl acl = Acl.of(user, role, condition); |
1239 | | - DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); |
| 1241 | + DatasetOption accessPolicyOption = DatasetOption.accessPolicyVersion(3); |
| 1242 | + DatasetOption viewOption = DatasetOption.datasetView(DatasetView.FULL); |
1240 | 1243 |
|
1241 | 1244 | Dataset dataset = |
1242 | 1245 | bigquery.create( |
1243 | 1246 | DatasetInfo.newBuilder(accessPolicyDataset) |
1244 | 1247 | .setDescription("Some Description") |
1245 | 1248 | .setAcl(ImmutableList.of(acl)) |
1246 | 1249 | .build(), |
1247 | | - datasetOption); |
| 1250 | + accessPolicyOption); |
1248 | 1251 | assertThat(dataset).isNotNull(); |
1249 | 1252 |
|
1250 | | - Dataset remoteDataset = bigquery.getDataset(accessPolicyDataset, datasetOption); |
| 1253 | + Dataset remoteDataset = |
| 1254 | + bigquery.getDataset(accessPolicyDataset, accessPolicyOption, viewOption); |
1251 | 1255 | assertNotNull(remoteDataset); |
1252 | 1256 | assertEquals(dataset.getDescription(), remoteDataset.getDescription()); |
1253 | 1257 | assertNotNull(remoteDataset.getCreationTime()); |
@@ -1356,14 +1360,16 @@ public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { |
1356 | 1360 | acls.add(acl); |
1357 | 1361 |
|
1358 | 1362 | DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); |
| 1363 | + DatasetOption updateModeOption = DatasetOption.updateMode(DatasetUpdateMode.UPDATE_FULL); |
1359 | 1364 | Dataset updatedDataset = |
1360 | 1365 | bigquery.update( |
1361 | 1366 | dataset.toBuilder() |
1362 | 1367 | .setDescription("Updated Description") |
1363 | 1368 | .setLabels(null) |
1364 | 1369 | .setAcl(acls) |
1365 | 1370 | .build(), |
1366 | | - datasetOption); |
| 1371 | + datasetOption, |
| 1372 | + updateModeOption); |
1367 | 1373 | assertNotNull(updatedDataset); |
1368 | 1374 | assertEquals(updatedDataset.getDescription(), "Updated Description"); |
1369 | 1375 | assertThat(updatedDataset.getLabels().isEmpty()); |
|
0 commit comments