Fix integration-arquillian
This commit is contained in:
parent
046edbbd54
commit
2a349673b9
4 changed files with 19 additions and 6 deletions
|
@ -18,6 +18,9 @@ public class RoleForm extends Form {
|
||||||
@FindBy(id = "description")
|
@FindBy(id = "description")
|
||||||
private WebElement descriptionInput;
|
private WebElement descriptionInput;
|
||||||
|
|
||||||
|
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='scopeParamRequired']]")
|
||||||
|
private OnOffSwitch scopeParamRequired;
|
||||||
|
|
||||||
@FindBy(xpath = ".//div[contains(@class,'onoffswitch') and ./input[@id='compositeSwitch']]")
|
@FindBy(xpath = ".//div[contains(@class,'onoffswitch') and ./input[@id='compositeSwitch']]")
|
||||||
private OnOffSwitch compositeSwitch;
|
private OnOffSwitch compositeSwitch;
|
||||||
|
|
||||||
|
@ -28,7 +31,7 @@ public class RoleForm extends Form {
|
||||||
private WebElement removeIcon;
|
private WebElement removeIcon;
|
||||||
|
|
||||||
public RoleRepresentation getRole() {
|
public RoleRepresentation getRole() {
|
||||||
RoleRepresentation role = new RoleRepresentation(getName(), getDescription());
|
RoleRepresentation role = new RoleRepresentation(getName(), getDescription(), isScopeParamRequired());
|
||||||
role.setComposite(isComposite());
|
role.setComposite(isComposite());
|
||||||
if (role.isComposite()) {
|
if (role.isComposite()) {
|
||||||
role.setComposites(compositeRoles.getComposites());
|
role.setComposites(compositeRoles.getComposites());
|
||||||
|
@ -44,6 +47,7 @@ public class RoleForm extends Form {
|
||||||
RoleRepresentation role = new RoleRepresentation();
|
RoleRepresentation role = new RoleRepresentation();
|
||||||
role.setName(getName());
|
role.setName(getName());
|
||||||
role.setDescription(getDescription());
|
role.setDescription(getDescription());
|
||||||
|
role.setScopeParamRequired(isScopeParamRequired());
|
||||||
role.setComposite(isComposite());
|
role.setComposite(isComposite());
|
||||||
log.info(role.getName() + ": " + role.getDescription() + ", comp: " + role.isComposite());
|
log.info(role.getName() + ": " + role.getDescription() + ", comp: " + role.isComposite());
|
||||||
return role;
|
return role;
|
||||||
|
@ -52,6 +56,7 @@ public class RoleForm extends Form {
|
||||||
public void setBasicAttributes(RoleRepresentation role) {
|
public void setBasicAttributes(RoleRepresentation role) {
|
||||||
setName(role.getName());
|
setName(role.getName());
|
||||||
setDescription(role.getDescription());
|
setDescription(role.getDescription());
|
||||||
|
setScopeParamRequired(role.isScopeParamRequired());
|
||||||
if (role.isComposite()) {
|
if (role.isComposite()) {
|
||||||
setCompositeRoles(role);
|
setCompositeRoles(role);
|
||||||
}
|
}
|
||||||
|
@ -82,6 +87,14 @@ public class RoleForm extends Form {
|
||||||
return getInputValue(descriptionInput);
|
return getInputValue(descriptionInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setScopeParamRequired(boolean scopeParamRequired) {
|
||||||
|
this.scopeParamRequired.setOn(scopeParamRequired);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isScopeParamRequired() {
|
||||||
|
return scopeParamRequired.isOn();
|
||||||
|
}
|
||||||
|
|
||||||
public void setComposite(boolean composite) {
|
public void setComposite(boolean composite) {
|
||||||
compositeSwitch.setOn(composite);
|
compositeSwitch.setOn(composite);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ClientRolesTest extends AbstractClientTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAddClientRole() {
|
public void testAddClientRole() {
|
||||||
ClientRepresentation newClient = createClientRepresentation("test-client1", "http://example.com/*");
|
ClientRepresentation newClient = createClientRepresentation("test-client1", "http://example.com/*");
|
||||||
RoleRepresentation newRole = new RoleRepresentation("client-role", "");
|
RoleRepresentation newRole = new RoleRepresentation("client-role", "", false);
|
||||||
|
|
||||||
createClient(newClient);
|
createClient(newClient);
|
||||||
assertFlashMessageSuccess();
|
assertFlashMessageSuccess();
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class DefaultRolesTest extends AbstractRolesTest {
|
||||||
@Before
|
@Before
|
||||||
public void beforeDefaultRolesTest() {
|
public void beforeDefaultRolesTest() {
|
||||||
// create a role via admin client
|
// create a role via admin client
|
||||||
defaultRoleRep = new RoleRepresentation("default-role", "");
|
defaultRoleRep = new RoleRepresentation("default-role", "", false);
|
||||||
rolesPage.rolesResource().create(defaultRoleRep);
|
rolesPage.rolesResource().create(defaultRoleRep);
|
||||||
|
|
||||||
defaultRolesPage.navigateTo();
|
defaultRolesPage.navigateTo();
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class RealmRolesTest extends AbstractRolesTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void beforeTestAddNewRole() {
|
public void beforeTestAddNewRole() {
|
||||||
testRole = new RoleRepresentation("test_role", "role description");
|
testRole = new RoleRepresentation("test_role", "role description", false);
|
||||||
realmRolesPage.navigateTo();
|
realmRolesPage.navigateTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public class RealmRolesTest extends AbstractRolesTest {
|
||||||
@Ignore
|
@Ignore
|
||||||
public void testAddRoleWithLongName() {
|
public void testAddRoleWithLongName() {
|
||||||
String name = "hjewr89y1894yh98(*&*&$jhjkashd)*(&y8934h*&@#hjkahsdj";
|
String name = "hjewr89y1894yh98(*&*&$jhjkashd)*(&y8934h*&@#hjkahsdj";
|
||||||
addRole(new RoleRepresentation(name, ""));
|
addRole(new RoleRepresentation(name, "", false));
|
||||||
assertNotNull(realmRolesPage.table().findRole(name));
|
assertNotNull(realmRolesPage.table().findRole(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class RealmRolesTest extends AbstractRolesTest {
|
||||||
Timer.time();
|
Timer.time();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
String roleName = String.format("%s%02d", namePrefix, i);
|
String roleName = String.format("%s%02d", namePrefix, i);
|
||||||
RoleRepresentation rr = new RoleRepresentation(roleName, "");
|
RoleRepresentation rr = new RoleRepresentation(roleName, "", false);
|
||||||
testRealmResource().roles().create(rr);
|
testRealmResource().roles().create(rr);
|
||||||
}
|
}
|
||||||
Timer.time("create " + count + " roles");
|
Timer.time("create " + count + " roles");
|
||||||
|
|
Loading…
Reference in a new issue