Merge pull request #2539 from guusdk/KEYCLOAK-2767
KEYCLOAK-2767: Should return a primitive if possible.
This commit is contained in:
commit
63ad95a766
3 changed files with 4 additions and 5 deletions
|
@ -29,7 +29,6 @@ import javax.ws.rs.QueryParam;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface UsersResource {
|
||||
|
||||
|
@ -55,7 +54,7 @@ public interface UsersResource {
|
|||
@Path("count")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Map<String, Integer> count();
|
||||
Integer count();
|
||||
|
||||
@Path("{id}")
|
||||
UserResource get(@PathParam("id") String id);
|
||||
|
|
|
@ -685,10 +685,10 @@ public class UsersResource {
|
|||
@GET
|
||||
@NoCache
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Map<String, Integer> getUsersCount() {
|
||||
public Integer getUsersCount() {
|
||||
auth.requireView();
|
||||
|
||||
return Collections.singletonMap("count", session.users().getUsersCount(realm));
|
||||
return session.users().getUsersCount(realm);
|
||||
}
|
||||
|
||||
@Path("{id}/role-mappings")
|
||||
|
|
|
@ -235,7 +235,7 @@ public class UserTest extends AbstractClientTest {
|
|||
public void count() {
|
||||
createUsers();
|
||||
|
||||
Integer count = realm.users().count().get("count");
|
||||
Integer count = realm.users().count();
|
||||
assertEquals(9, count.intValue());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue