-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: introduce constants for test account credentials
- Loading branch information
1 parent
0d2caba
commit 2b79ea6
Showing
1 changed file
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,13 @@ | |
@ContextConfiguration(classes = DefaultIntegrationTestConfig.class) | ||
public class SamlLoginIT { | ||
|
||
public static final String MARISSA4_USERNAME = "marissa4"; | ||
private static final String MARISSA4_PASSWORD = "saml2"; | ||
public static final String MARISSA4_EMAIL = "[email protected]"; | ||
public static final String MARISSA2_USERNAME = "marissa2"; | ||
private static final String MARISSA2_PASSWORD = "saml2"; | ||
public static final String MARISSA3_USERNAME = "marissa3"; | ||
private static final String MARISSA3_PASSWORD = "saml2"; | ||
private static final String SAML_ORIGIN = "simplesamlphp"; | ||
@Autowired @Rule | ||
public IntegrationTestRule integrationTestRule; | ||
|
@@ -456,13 +463,13 @@ public void testGroupIntegration() throws Exception { | |
createIdentityProvider(SAML_ORIGIN); | ||
LoginPage.go(webDriver, baseUrl) | ||
.startSamlLogin() | ||
.login("marissa4", "saml2"); | ||
.login(MARISSA4_USERNAME, MARISSA4_PASSWORD); | ||
} | ||
|
||
@Test | ||
public void testFavicon_Should_Not_Save() throws Exception { | ||
webDriver.get(baseUrl + "/favicon.ico"); | ||
testSimpleSamlLogin("/login", "Where to?", "marissa4", "saml2"); | ||
testSimpleSamlLogin("/login", "Where to?", MARISSA4_USERNAME, MARISSA4_PASSWORD); | ||
} | ||
|
||
|
||
|
@@ -536,13 +543,13 @@ protected void deleteUser(String origin, String username) { | |
|
||
@Test | ||
public void test_SamlInvitation_Automatic_Redirect_In_Zone2() throws Exception { | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa2", "saml2", true); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa2", "saml2", true); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa2", "saml2", true); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA2_USERNAME, MARISSA2_PASSWORD, true); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA2_USERNAME, MARISSA2_PASSWORD, true); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA2_USERNAME, MARISSA2_PASSWORD, true); | ||
|
||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa3", "saml2", false); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa3", "saml2", false); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2("marissa3", "saml2", false); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA3_USERNAME, MARISSA3_PASSWORD, false); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA3_USERNAME, MARISSA3_PASSWORD, false); | ||
perform_SamlInvitation_Automatic_Redirect_In_Zone2(MARISSA3_USERNAME, MARISSA3_PASSWORD, false); | ||
} | ||
|
||
public void perform_SamlInvitation_Automatic_Redirect_In_Zone2(String username, String password, boolean emptyList) { | ||
|
@@ -855,16 +862,16 @@ public void testSamlLogin_Map_Groups_In_Zone1() { | |
//we should now be in the Simple SAML PHP site | ||
webDriver.findElement(By.xpath(SIMPLESAMLPHP_LOGIN_PROMPT_XPATH_EXPR)); | ||
webDriver.findElement(By.name("username")).clear(); | ||
webDriver.findElement(By.name("username")).sendKeys("marissa4"); | ||
webDriver.findElement(By.name("password")).sendKeys("saml2"); | ||
webDriver.findElement(By.name("username")).sendKeys(MARISSA4_USERNAME); | ||
webDriver.findElement(By.name("password")).sendKeys(MARISSA4_PASSWORD); | ||
webDriver.findElement(By.xpath("//input[@value='Login']")).click(); | ||
|
||
assertThat(webDriver.findElement(By.cssSelector("h1")).getText(), Matchers.containsString("Where to?")); | ||
webDriver.get(baseUrl + "/logout.do"); | ||
webDriver.get(zoneUrl + "/logout.do"); | ||
|
||
//validate that the groups were mapped | ||
String samlUserId = IntegrationTestUtils.getUserId(adminTokenInZone, zoneUrl, provider.getOriginKey(), "[email protected]"); | ||
String samlUserId = IntegrationTestUtils.getUserId(adminTokenInZone, zoneUrl, provider.getOriginKey(), MARISSA4_EMAIL); | ||
uaaSamlUserGroup = IntegrationTestUtils.getGroup(adminTokenInZone, null, zoneUrl, "uaa.saml.user"); | ||
uaaSamlAdminGroup = IntegrationTestUtils.getGroup(adminTokenInZone, null, zoneUrl, "uaa.saml.admin"); | ||
assertTrue(isMember(samlUserId, uaaSamlUserGroup)); | ||
|