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.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface UsersResource {
|
public interface UsersResource {
|
||||||
|
|
||||||
|
@ -55,7 +54,7 @@ public interface UsersResource {
|
||||||
@Path("count")
|
@Path("count")
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
Map<String, Integer> count();
|
Integer count();
|
||||||
|
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
UserResource get(@PathParam("id") String id);
|
UserResource get(@PathParam("id") String id);
|
||||||
|
|
|
@ -685,10 +685,10 @@ public class UsersResource {
|
||||||
@GET
|
@GET
|
||||||
@NoCache
|
@NoCache
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Map<String, Integer> getUsersCount() {
|
public Integer getUsersCount() {
|
||||||
auth.requireView();
|
auth.requireView();
|
||||||
|
|
||||||
return Collections.singletonMap("count", session.users().getUsersCount(realm));
|
return session.users().getUsersCount(realm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Path("{id}/role-mappings")
|
@Path("{id}/role-mappings")
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class UserTest extends AbstractClientTest {
|
||||||
public void count() {
|
public void count() {
|
||||||
createUsers();
|
createUsers();
|
||||||
|
|
||||||
Integer count = realm.users().count().get("count");
|
Integer count = realm.users().count();
|
||||||
assertEquals(9, count.intValue());
|
assertEquals(9, count.intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue