nastra commented on issue #7160:
URL: https://github.com/apache/iceberg/issues/7160#issuecomment-1480718595

   I think in a lot of cases we don't necessarily need `.describedAs(..)` / 
`.as(..)` as the context that is being provided when a check fails is usually 
enough. Taking the below example:
   ```
   Assert.assertTrue("OSS file should exist", 
ossClient().get().doesObjectExist(uri.bucket(), uri.key()));
   Assert.assertEquals("Should have expected location", location, 
out.location());
   Assert.assertEquals("Should have expected length", dataSize, 
ossDataLength(uri));
   Assert.assertArrayEquals("Should have expected content", data, 
ossDataContent(uri, dataSize));
   ```
   
   which could be rewritten to:
   ```
   Assertions.assertThat(ossClient().get().doesObjectExist(uri.bucket(), 
uri.key())).as("OSS file should exist").isTrue();
   Assertions.assertThat(out.location()).isEqualTo(location);
   Assertions.assertThat(ossDataLength(uri)).isEqualTo(dataSize);
   Assertions.assertThat(ossDataContent(uri, dataSize)).isEqualTo(data);
   ```
   
   That being said, we should just double-check when transitioning/reviewing 
where it makes sense to have a failure description / overriding error msg.
   


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to