dennishuo commented on code in PR #575:
URL: https://github.com/apache/polaris/pull/575#discussion_r1889094214
##########
polaris-service/src/test/java/org/apache/polaris/service/catalog/TestUtil.java:
##########
@@ -140,7 +140,10 @@ public static RESTCatalog createSnowmanManagedCatalog(
.header("Authorization", "Bearer " + adminToken.token())
.header(REALM_PROPERTY_KEY, realm)
.get()) {
- assertThat(response).returns(Response.Status.OK.getStatusCode(),
Response::getStatus);
+ // Buffer the entity so we can read it multiple times
+ response.bufferEntity();
Review Comment:
Seems like we read the response multiple times for all the assertion lines,
not just this one -- should this be inside the
`assertStatusCodeWithFailMessage` helper method?
I guess maybe we get away with it if the entity is an empty body for CREATED
response codes, but generally it'd still be better if the caller doesn't have
to know about whether or not the helper method "needs" the response to have
`bufferEntity()` based on assumed contents.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]