-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: cloudresourcemanagerIssues related to the Resource Manager API.Issues related to the Resource Manager API.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
When implementing integration tests for DNS, I noticed that if one restricts the fields to be retrieved for a list operation, iterateAll()
does not work properly. The following test would always fail:
dnsRecordIterator = DNS.listDnsRecords(zone.name(),
Dns.DnsRecordListOption.fields(Dns.DnsRecordField.TYPE),
Dns.DnsRecordListOption.pageSize(1)).iterateAll(); // to force the iterator fetch next page
int counter = 0;
while (dnsRecordIterator.hasNext()) {
counter++;
}
assertEquals(2, counter);
This is because the field selector silently prevents the service from returning the nextPageToken
:
builder.append("rrsets(").append(DnsRecordField.selector(fields)).append(')');
instead of
builder.append("nextPageToken,rrsets(").append(DnsRecordField.selector(fields)).append(')');
I recall seeing the same handling in resource manage. Having discussed this with @ajkannan, this is likely a bug. The same bug may be present in other parts of the library when a combination of listing and field restriction is possible.
Metadata
Metadata
Assignees
Labels
api: cloudresourcemanagerIssues related to the Resource Manager API.Issues related to the Resource Manager API.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.