diff --git a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withAllThreeRoles.md b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withAllThreeRoles.md index 9854828..77f5add 100644 --- a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withAllThreeRoles.md +++ b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withAllThreeRoles.md @@ -25,7 +25,7 @@ | GET | /guest-only | GUEST | | DELETE | /items/{id} | ADMIN | | GET | /items/{id} | ADMIN | -| GET | /locked | | +| GET | /locked | {FORBIDDEN} | | GET | /not-found | USER | | GET | /public | {⚠ PERMIT_ALL ⚠} | | GET | /server-error | USER | diff --git a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withCustomizedMarkdownTableRenderer.md b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withCustomizedMarkdownTableRenderer.md index ba4268d..c6ef412 100644 --- a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withCustomizedMarkdownTableRenderer.md +++ b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withCustomizedMarkdownTableRenderer.md @@ -15,7 +15,7 @@ | GET | /guest-only | GUEST | | DELETE | /items/{id} | ADMIN | | GET | /items/{id} | ADMIN | -| GET | /locked | | +| GET | /locked | {FORBIDDEN} | | GET | /not-found | USER | | GET | /public | {PUBLIC} | | GET | /server-error | USER | diff --git a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withDPoPCredentials.md b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withDPoPCredentials.md index ba8de24..a04ab49 100644 --- a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withDPoPCredentials.md +++ b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withDPoPCredentials.md @@ -12,10 +12,10 @@ | GET | /any-role | {ANY_ROLE} | | GET | /authenticated | {AUTHENTICATED} | | GET | /gone | USER | -| GET | /guest-only | | +| GET | /guest-only | {FORBIDDEN} | | DELETE | /items/{id} | ADMIN | | GET | /items/{id} | ADMIN | -| GET | /locked | | +| GET | /locked | {FORBIDDEN} | | GET | /not-found | USER | | GET | /public | {⚠ PERMIT_ALL ⚠} | | GET | /server-error | USER | diff --git a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withIgnoredActuatorPrefix.md b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withIgnoredActuatorPrefix.md index c95a610..009b824 100644 --- a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withIgnoredActuatorPrefix.md +++ b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withIgnoredActuatorPrefix.md @@ -15,7 +15,7 @@ | GET | /guest-only | GUEST | | DELETE | /items/{id} | ADMIN | | GET | /items/{id} | ADMIN | -| GET | /locked | | +| GET | /locked | {FORBIDDEN} | | GET | /not-found | USER | | GET | /public | {⚠ PERMIT_ALL ⚠} | | GET | /server-error | USER | diff --git a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withMixedCredentials.md b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withMixedCredentials.md index c95a610..009b824 100644 --- a/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withMixedCredentials.md +++ b/spring-boot-tests/authorization-test/data/test/validation/AuthorizationTestUtilTest_buildAuthorizationMatrix_withMixedCredentials.md @@ -15,7 +15,7 @@ | GET | /guest-only | GUEST | | DELETE | /items/{id} | ADMIN | | GET | /items/{id} | ADMIN | -| GET | /locked | | +| GET | /locked | {FORBIDDEN} | | GET | /not-found | USER | | GET | /public | {⚠ PERMIT_ALL ⚠} | | GET | /server-error | USER | diff --git a/src/authorizationTestSupport/java/de/cronn/testutils/authorization/MarkdownTableRenderer.java b/src/authorizationTestSupport/java/de/cronn/testutils/authorization/MarkdownTableRenderer.java index 43f247c..730ca27 100644 --- a/src/authorizationTestSupport/java/de/cronn/testutils/authorization/MarkdownTableRenderer.java +++ b/src/authorizationTestSupport/java/de/cronn/testutils/authorization/MarkdownTableRenderer.java @@ -74,6 +74,8 @@ protected String formatAllowedCell(EndpointResult result, Set allCredent Set allowed = new LinkedHashSet<>(result.allowedRoles()); if (allowed.equals(allCredentialNames)) { return "{ANY_ROLE}"; + } else if (allowed.isEmpty()) { + return "{FORBIDDEN}"; } else { return String.join("
", allowed); }