@@ -146,6 +146,7 @@ public class ITBigQueryTest {
146146 private static final String MODEL_DATASET = RemoteBigQueryHelper .generateDatasetName ();
147147 private static final String ROUTINE_DATASET = RemoteBigQueryHelper .generateDatasetName ();
148148 private static final String PROJECT_ID = ServiceOptions .getDefaultProjectId ();
149+ private static final String RANDOM_ID = UUID .randomUUID ().toString ().substring (0 , 8 );
149150 private static final Map <String , String > LABELS =
150151 ImmutableMap .of (
151152 "example-label1" , "example-value1" ,
@@ -1425,6 +1426,29 @@ public void testModelLifecycle() throws InterruptedException {
14251426 assertTrue (bigquery .delete (modelId ));
14261427 }
14271428
1429+ @ Test
1430+ public void testEmptyListModels () {
1431+ String datasetId = "test_empty_dataset_list_models_" + RANDOM_ID ;
1432+ assertNotNull (bigquery .create (DatasetInfo .of (datasetId )));
1433+ Page <Model > models = bigquery .listModels (datasetId , BigQuery .ModelListOption .pageSize (100 ));
1434+ assertEquals (0 , Iterables .size (models .getValues ()));
1435+ assertFalse (models .hasNextPage ());
1436+ assertNull (models .getNextPageToken ());
1437+ assertTrue (bigquery .delete (datasetId ));
1438+ }
1439+
1440+ @ Test
1441+ public void testEmptyListRoutines () {
1442+ String datasetId = "test_empty_dataset_list_routines_" + RANDOM_ID ;
1443+ assertNotNull (bigquery .create (DatasetInfo .of (datasetId )));
1444+ Page <Routine > routines =
1445+ bigquery .listRoutines (datasetId , BigQuery .RoutineListOption .pageSize (100 ));
1446+ assertEquals (0 , Iterables .size (routines .getValues ()));
1447+ assertFalse (routines .hasNextPage ());
1448+ assertNull (routines .getNextPageToken ());
1449+ assertTrue (bigquery .delete (datasetId ));
1450+ }
1451+
14281452 @ Test
14291453 public void testRoutineLifecycle () throws InterruptedException {
14301454
0 commit comments