Fix integration-arquillian

This commit is contained in:
mposolda 2015-09-23 14:47:20 +02:00
parent 046edbbd54
commit 2a349673b9
4 changed files with 19 additions and 6 deletions

View file

@ -18,6 +18,9 @@ public class RoleForm extends Form {
@FindBy(id = "description")
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']]")
private OnOffSwitch compositeSwitch;
@ -28,7 +31,7 @@ public class RoleForm extends Form {
private WebElement removeIcon;
public RoleRepresentation getRole() {
RoleRepresentation role = new RoleRepresentation(getName(), getDescription());
RoleRepresentation role = new RoleRepresentation(getName(), getDescription(), isScopeParamRequired());
role.setComposite(isComposite());
if (role.isComposite()) {
role.setComposites(compositeRoles.getComposites());
@ -44,6 +47,7 @@ public class RoleForm extends Form {
RoleRepresentation role = new RoleRepresentation();
role.setName(getName());
role.setDescription(getDescription());
role.setScopeParamRequired(isScopeParamRequired());
role.setComposite(isComposite());
log.info(role.getName() + ": " + role.getDescription() + ", comp: " + role.isComposite());
return role;
@ -52,6 +56,7 @@ public class RoleForm extends Form {
public void setBasicAttributes(RoleRepresentation role) {
setName(role.getName());
setDescription(role.getDescription());
setScopeParamRequired(role.isScopeParamRequired());
if (role.isComposite()) {
setCompositeRoles(role);
}
@ -82,6 +87,14 @@ public class RoleForm extends Form {
return getInputValue(descriptionInput);
}
public void setScopeParamRequired(boolean scopeParamRequired) {
this.scopeParamRequired.setOn(scopeParamRequired);
}
public boolean isScopeParamRequired() {
return scopeParamRequired.isOn();
}
public void setComposite(boolean composite) {
compositeSwitch.setOn(composite);
}

View file

@ -44,7 +44,7 @@ public class ClientRolesTest extends AbstractClientTest {
@Test
public void testAddClientRole() {
ClientRepresentation newClient = createClientRepresentation("test-client1", "http://example.com/*");
RoleRepresentation newRole = new RoleRepresentation("client-role", "");
RoleRepresentation newRole = new RoleRepresentation("client-role", "", false);
createClient(newClient);
assertFlashMessageSuccess();

View file

@ -30,7 +30,7 @@ public class DefaultRolesTest extends AbstractRolesTest {
@Before
public void beforeDefaultRolesTest() {
// create a role via admin client
defaultRoleRep = new RoleRepresentation("default-role", "");
defaultRoleRep = new RoleRepresentation("default-role", "", false);
rolesPage.rolesResource().create(defaultRoleRep);
defaultRolesPage.navigateTo();

View file

@ -32,7 +32,7 @@ public class RealmRolesTest extends AbstractRolesTest {
@Before
public void beforeTestAddNewRole() {
testRole = new RoleRepresentation("test_role", "role description");
testRole = new RoleRepresentation("test_role", "role description", false);
realmRolesPage.navigateTo();
}
@ -104,7 +104,7 @@ public class RealmRolesTest extends AbstractRolesTest {
@Ignore
public void testAddRoleWithLongName() {
String name = "hjewr89y1894yh98(*&*&$jhjkashd)*(&y8934h*&@#hjkahsdj";
addRole(new RoleRepresentation(name, ""));
addRole(new RoleRepresentation(name, "", false));
assertNotNull(realmRolesPage.table().findRole(name));
}
@ -124,7 +124,7 @@ public class RealmRolesTest extends AbstractRolesTest {
Timer.time();
for (int i = 0; i < count; i++) {
String roleName = String.format("%s%02d", namePrefix, i);
RoleRepresentation rr = new RoleRepresentation(roleName, "");
RoleRepresentation rr = new RoleRepresentation(roleName, "", false);
testRealmResource().roles().create(rr);
}
Timer.time("create " + count + " roles");