diff --git a/src/test/java/org/italiangrid/storm/webdav/test/authz/pdp/ScopePathAuthzPdpTests.java b/src/test/java/org/italiangrid/storm/webdav/test/authz/pdp/ScopePathAuthzPdpTests.java index 0a1cdd7b..18b3dfe6 100644 --- a/src/test/java/org/italiangrid/storm/webdav/test/authz/pdp/ScopePathAuthzPdpTests.java +++ b/src/test/java/org/italiangrid/storm/webdav/test/authz/pdp/ScopePathAuthzPdpTests.java @@ -110,7 +110,7 @@ void invalidAuthentication() { } @Test - void noScopeClaimYeldsIndeterminate() throws Exception { + void noScopeClaimYeldsIndeterminate() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn(null); PathAuthorizationResult result = pdp.authorizeRequest(newAuthorizationRequest(request, jwtAuth)); @@ -120,7 +120,7 @@ void noScopeClaimYeldsIndeterminate() throws Exception { } @Test - void noSaYeldsIndeterminate() throws Exception { + void noSaYeldsIndeterminate() { when(pathResolver.resolveStorageArea("/test/example")).thenReturn(null); PathAuthorizationResult result = @@ -131,7 +131,7 @@ void noSaYeldsIndeterminate() throws Exception { } @Test - void noStorageScopesYeldsDeny() throws Exception { + void noStorageScopesYeldsDeny() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid profile storage.read"); PathAuthorizationResult result = @@ -229,7 +229,7 @@ void readMethodsRequestsRequireStorageReadOrStage() { } @Test - void replaceMethodsRequestsRequireStorageModifyOrCreate() throws Exception { + void replaceMethodsRequestsRequireStorageModifyOrCreate() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.read:/"); for (String m : REPLACE_METHODS) { @@ -273,7 +273,7 @@ void replaceMethodsRequestsRequireStorageModifyOrCreate() throws Exception { } @Test - void modifyMethodsRequestsRequireStorageModifyOrCreate() throws Exception { + void modifyMethodsRequestsRequireStorageModifyOrCreate() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.read:/ storage.create:/"); for (String m : MODIFY_METHODS) { @@ -296,7 +296,7 @@ void modifyMethodsRequestsRequireStorageModifyOrCreate() throws Exception { } @Test - void testLocalCopyRequiresStorageCreateOrModify() throws Exception { + void testLocalCopyRequiresStorageCreateOrModify() { when(request.getMethod()).thenReturn(COPY_METHOD); when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.modify:/"); @@ -313,7 +313,7 @@ void testLocalCopyRequiresStorageCreateOrModify() throws Exception { } @Test - void testPullTpcRequiresCreateOrModify() throws Exception { + void testPullTpcRequiresCreateOrModify() { when(request.getMethod()).thenReturn(COPY_METHOD); when(request.getHeader("Source")).thenReturn("https://remote.example/test/example"); when(pathResolver.pathExists("/test/example")).thenReturn(true); @@ -341,7 +341,7 @@ void testPullTpcRequiresCreateOrModify() throws Exception { } @Test - void testPushTpcRequiresRead() throws Exception { + void testPushTpcRequiresRead() { when(request.getMethod()).thenReturn(COPY_METHOD); when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.create:/ storage.modify:/"); PathAuthorizationResult result = @@ -357,7 +357,7 @@ void testPushTpcRequiresRead() throws Exception { } @Test - void testMoveRequiresModify() throws Exception { + void testMoveRequiresModify() { when(request.getMethod()).thenReturn(MOVE_METHOD); when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.read:/ storage.create:/"); PathAuthorizationResult result = @@ -373,7 +373,7 @@ void testMoveRequiresModify() throws Exception { } @Test - void testModifyImpliesCreate() throws Exception { + void testModifyImpliesCreate() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.read:/ storage.modify:/"); when(pathResolver.pathExists("/test/example")).thenReturn(false); @@ -386,7 +386,7 @@ void testModifyImpliesCreate() throws Exception { } @Test - void testUnsupportedMethod() throws Exception { + void testUnsupportedMethod() { when(request.getMethod()).thenReturn("TRACE"); assertThrows(IllegalArgumentException.class, () -> { pdp.authorizeRequest(newAuthorizationRequest(request, jwtAuth)); @@ -394,7 +394,7 @@ void testUnsupportedMethod() throws Exception { } @Test - void testPathAuthzIsEnforced() throws Exception { + void testPathAuthzIsEnforced() { when(jwt.getClaimAsString(SCOPE_CLAIM)).thenReturn("openid storage.read:/subfolder"); when(request.getMethod()).thenReturn("GET"); PathAuthorizationResult result =