diff --git a/src/test/java/org/commonjava/indy/service/ui/jaxrs/auth/AuthResourceTest.java b/src/test/java/org/commonjava/indy/service/ui/jaxrs/auth/AuthResourceTest.java index 194961f..53f52ab 100644 --- a/src/test/java/org/commonjava/indy/service/ui/jaxrs/auth/AuthResourceTest.java +++ b/src/test/java/org/commonjava/indy/service/ui/jaxrs/auth/AuthResourceTest.java @@ -42,4 +42,13 @@ public void testGetUserInfo() assertThat( resultPath.getInt( "roles.size" ), is( 2 ) ); assertThat( resultPath.getList( "roles" ), hasItems( "power", "admin" ) ); } + + @Test + public void testGetUserInfoNotAuth() + { + given().when() + .get( "/api/admin/auth/userinfo" ) + .then() + .statusCode( Response.Status.UNAUTHORIZED.getStatusCode() ); + } }