rdblue commented on code in PR #6029:
URL: https://github.com/apache/iceberg/pull/6029#discussion_r1001906905
##########
aws/src/integration/java/org/apache/iceberg/aws/TestAssumeRoleAwsClientFactory.java:
##########
@@ -128,20 +130,15 @@ public void testAssumeRoleGlueCatalog() throws Exception {
GlueCatalog glueCatalog = new GlueCatalog();
assumeRoleProperties.put("warehouse", "s3://path");
glueCatalog.initialize("test", assumeRoleProperties);
- try {
- glueCatalog.createNamespace(
- Namespace.of("denied_" + UUID.randomUUID().toString().replace("-",
"")));
- Assert.fail("Access to Glue should be denied");
- } catch (GlueException e) {
- Assert.assertEquals(AccessDeniedException.class, e.getClass());
- }
+ Assertions.assertThatThrownBy(
+ () ->
+ glueCatalog.createNamespace(
+ Namespace.of("denied_" +
UUID.randomUUID().toString().replace("-", ""))))
+ .isInstanceOf(AccessDeniedException.class);
Namespace namespace = Namespace.of("allowed_" +
UUID.randomUUID().toString().replace("-", ""));
try {
glueCatalog.createNamespace(namespace);
- } catch (GlueException e) {
- LOG.error("fail to create or delete Glue database", e);
- Assert.fail("create namespace should succeed");
Review Comment:
Is the idea here that the whole test will fail so we don't need to assert?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]