This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-redback-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 095a901  Decreasing output for tests
095a901 is described below

commit 095a901424f377eeec188a6d6310d7e1d4eadcf5
Author: Martin Stockhammer <[email protected]>
AuthorDate: Sat Jan 9 13:01:30 2021 +0100

    Decreasing output for tests
---
 .../apache/archiva/redback/rest/services/v2/DefaultUserService.java | 2 +-
 .../archiva/redback/rest/services/v2/NativeRoleServiceTest.java     | 6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultUserService.java
 
b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultUserService.java
index 30983bb..46061eb 100644
--- 
a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultUserService.java
+++ 
b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/v2/DefaultUserService.java
@@ -449,7 +449,7 @@ public class DefaultUserService extends BaseRedbackService
         throws RedbackServiceException
     {
         RedbackPrincipal principal = getPrincipal( );
-        if ( principal == null )
+        if ( principal == null || principal.getUser()==null )
         {
             throw new RedbackServiceException( ErrorMessage.of( 
MessageKeys.ERR_AUTH_UNAUTHORIZED_REQUEST ), 401 );
         }
diff --git 
a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeRoleServiceTest.java
 
b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeRoleServiceTest.java
index 8cd8384..59b2c25 100644
--- 
a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeRoleServiceTest.java
+++ 
b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/v2/NativeRoleServiceTest.java
@@ -346,7 +346,7 @@ public class NativeRoleServiceTest extends 
AbstractNativeRestServices
     {
         String token = getAdminToken( );
         Response response = given( ).spec( getRequestSpec( token ) 
).contentType( JSON )
-            .when( ).get( "archiva-system-administrator" ).prettyPeek( ).then( 
).statusCode( 200 ).extract( ).response( );
+            .when( ).get( "archiva-system-administrator" ).then( ).statusCode( 
200 ).extract( ).response( );
         assertNotNull( response );
         RoleInfo roleInfo = response.getBody( ).jsonPath( ).getObject( "", 
RoleInfo.class );
         assertNotNull( roleInfo );
@@ -539,7 +539,6 @@ public class NativeRoleServiceTest extends 
AbstractNativeRestServices
             Response result = given( ).spec( getRequestSpec( token ) 
).contentType( JSON )
                 .when( )
                 .get( "archiva-global-repository-observer/unassigned" )
-                .prettyPeek()
                 .then( ).statusCode( 200 ).extract( ).response( );
             assertNotNull(result);
             PagedResult<UserInfo> userResult = result.getBody( ).jsonPath( 
).getObject( "", PagedResult.class );
@@ -583,7 +582,6 @@ public class NativeRoleServiceTest extends 
AbstractNativeRestServices
                 .when( )
                 .param( "recurse")
                 .get( "archiva-global-repository-observer/user" )
-                .prettyPeek()
                 .then( ).statusCode( 200 ).extract( ).response( );
             assertNotNull(result);
             PagedResult<UserInfo> userResult = result.getBody( ).jsonPath( 
).getObject( "", PagedResult.class );
@@ -626,7 +624,6 @@ public class NativeRoleServiceTest extends 
AbstractNativeRestServices
                 .when( )
                 .param( "recurse" )
                 .get( "archiva-global-repository-observer/unassigned" )
-                .prettyPeek()
                 .then( ).statusCode( 200 ).extract( ).response( );
             assertNotNull(result);
             PagedResult<UserInfo> userResult = result.getBody( ).jsonPath( 
).getObject( "", PagedResult.class );
@@ -670,7 +667,6 @@ public class NativeRoleServiceTest extends 
AbstractNativeRestServices
                 .when( )
                 .param( "recurse","parentsOnly")
                 .get( "archiva-global-repository-observer/user" )
-                .prettyPeek()
                 .then( ).statusCode( 200 ).extract( ).response( );
             assertNotNull(result);
             PagedResult<UserInfo> userResult = result.getBody( ).jsonPath( 
).getObject( "", PagedResult.class );

Reply via email to