Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use pages empty #753

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

import com.google.api.core.CurrentMillisClock;
import com.google.api.gax.paging.Page;
import com.google.api.gax.paging.Pages;
import com.google.cloud.RetryOption;
import com.google.cloud.bigquery.JobStatistics.CopyStatistics;
import com.google.cloud.bigquery.JobStatistics.QueryStatistics;
import com.google.cloud.bigquery.JobStatus.State;
import com.google.common.collect.ImmutableList;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
Expand Down Expand Up @@ -304,39 +304,11 @@ public void testWaitForAndGetQueryResults() throws InterruptedException {
.setStatus(JOB_STATUS)
.build();

JobStatus status = mock(JobStatus.class);
when(bigquery.getOptions()).thenReturn(mockOptions);
when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock());
Job completedJob =
expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build();
// TODO(pongad): remove when we bump gax to 1.15.
Page<FieldValueList> singlePage =
new Page<FieldValueList>() {
@Override
public boolean hasNextPage() {
return false;
}

@Override
public String getNextPageToken() {
return "";
}

@Override
public Page<FieldValueList> getNextPage() {
return null;
}

@Override
public Iterable<FieldValueList> iterateAll() {
return Collections.emptyList();
}

@Override
public Iterable<FieldValueList> getValues() {
return Collections.emptyList();
}
};
Page<FieldValueList> singlePage = Pages.empty();
TableResult result = new TableResult(Schema.of(), 1, singlePage);
QueryResponse completedQuery =
QueryResponse.newBuilder()
Expand Down