From bcdc1f24b631c39a06d49fedff8570e343f8d8c5 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Tue, 4 Aug 2020 18:06:49 +0200 Subject: [PATCH] Changing return to void for delete action --- .../archiva/redback/rest/api/services/v2/GroupService.java | 2 +- .../archiva/redback/rest/services/v2/DefaultGroupService.java | 4 ++-- .../redback/rest/services/v2/NativeGroupServiceTest.java | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/v2/GroupService.java b/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/v2/GroupService.java index b2164983..851f07fe 100644 --- a/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/v2/GroupService.java +++ b/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/v2/GroupService.java @@ -117,7 +117,7 @@ public interface GroupService @ApiResponse( responseCode = "404", description = "Group mapping not found" ) } ) - ActionStatus removeGroupMapping( @Parameter( description = "The group name", required = true ) + void removeGroupMapping( @Parameter( description = "The group name", required = true ) @PathParam( "group" ) String group ) throws RedbackServiceException; diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultGroupService.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultGroupService.java index d5610acb..e4dbf867 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultGroupService.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultGroupService.java @@ -201,7 +201,7 @@ public class DefaultGroupService } @Override - public ActionStatus removeGroupMapping( String group ) + public void removeGroupMapping( String group ) throws RedbackServiceException { try @@ -213,7 +213,7 @@ public class DefaultGroupService log.error( e.getMessage(), e ); throw new RedbackServiceException( ErrorMessage.of( ERR_ROLE_MAPPING, e.getMessage( ) ) ); } - return ActionStatus.SUCCESS; + response.setStatus( 200 ); } @Override diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeGroupServiceTest.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeGroupServiceTest.java index ce2bcb1d..4129adbf 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeGroupServiceTest.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeGroupServiceTest.java @@ -454,7 +454,6 @@ public class NativeGroupServiceTest extends AbstractNativeRestServices .delete( "/mappings/archiva-admin" ) .then( ) .statusCode( 200 ).extract( ).response( ); - assertTrue( response.getBody( ).jsonPath( ).getBoolean( "success" ) ); } finally { // Put it back Map jsonAsMap = new HashMap<>( );