Merge pull request #718 from stianst/master
KEYCLOAK-725 Add realm update to the Admin Client
This commit is contained in:
commit
617c61034f
2 changed files with 20 additions and 0 deletions
|
@ -2,8 +2,10 @@ package org.keycloak.admin.client.resource;
|
|||
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
@ -17,6 +19,10 @@ public interface RealmResource {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public RealmRepresentation toRepresentation();
|
||||
|
||||
@PUT
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public void update(RealmRepresentation realmRepresentation);
|
||||
|
||||
@Path("applications")
|
||||
public ApplicationsResource applications();
|
||||
|
||||
|
|
|
@ -46,6 +46,20 @@ public class RealmTest extends AbstractClientTest {
|
|||
assertNames(keycloak.realms().findAll(), "master", "test");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateRealm() {
|
||||
RealmRepresentation rep = realm.toRepresentation();
|
||||
rep.setSsoSessionIdleTimeout(123);
|
||||
rep.setSsoSessionMaxLifespan(12);
|
||||
|
||||
realm.update(rep);
|
||||
|
||||
rep = realm.toRepresentation();
|
||||
|
||||
assertEquals(123, rep.getSsoSessionIdleTimeout().intValue());
|
||||
assertEquals(12, rep.getSsoSessionMaxLifespan().intValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRealmRepresentation() {
|
||||
RealmRepresentation rep = realm.toRepresentation();
|
||||
|
|
Loading…
Reference in a new issue