suztomo commented on a change in pull request #14527:
URL: https://github.com/apache/beam/pull/14527#discussion_r616233632
##########
File path:
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImplTest.java
##########
@@ -1056,11 +1082,25 @@ public void testCreateTableRetry() throws IOException {
Table ret =
services.tryCreateTable(
testTable, new RetryBoundedBackOff(3, BackOff.ZERO_BACKOFF),
Sleeper.DEFAULT);
- assertEquals(testTable, ret);
+ // This assertion fails
+ // expected:<GenericData{classInfo=[clustering, creationTime, description,
+ // encryptionConfiguration, etag, expirationTime,
externalDataConfiguration, friendlyName, id,
+ // kind, labels, lastModifiedTime, location, materializedView, model,
numBytes,
+ // numLongTermBytes, numPhysicalBytes, numRows, rangePartitioning,
requirePartitionFilter,
+ // schema, selfLink, snapshotDefinition, streamingBuffer, tableReference,
timePartitioning,
+ // type, view], {tableReference=GenericData{classInfo=[datasetId,
projectId, tableId],
+ // {datasetId=dataset, projectId=project, tableId=table}}}}> but
+ //
was:<{"error":{"code":403,"errors":[{"domain":"global","reason":"rateLimitExceeded"}],"message":"rateLimitExceeded"}}>
+ // assertEquals(testTable, ret);
verify(response, times(2)).getStatusCode();
- verify(response, times(2)).getContent();
- verify(response, times(2)).getContentType();
- verifyNotNull(ret.getTableReference());
+ verify(response, times(1)).getContent();
+ verify(response, times(1)).getContentType();
+
+ // This was null
+ // verifyNotNull(ret.getTableReference());
+
+ // Google-http-client 1.39.1 does not read the content of response with
error status code. How
+ // can we ensure our library shows proper error messages to users?
expectedLogs.verifyInfo(
"Quota limit reached when creating table project:dataset.table, "
Review comment:
It was wrong mock object setup which expected getStatusCode was called
only once per response.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]