r3455 - trunk/pollen-ui-struts2-test/src/test/java/org/chorem/pollen/ui/security
Author: ymartel Date: 2012-06-12 18:23:53 +0200 (Tue, 12 Jun 2012) New Revision: 3455 Url: http://chorem.org/repositories/revision/pollen/3455 Log: refs #606 : add tests for security access with a normal poll Modified: trunk/pollen-ui-struts2-test/src/test/java/org/chorem/pollen/ui/security/SecurityAccessSIT.java Modified: trunk/pollen-ui-struts2-test/src/test/java/org/chorem/pollen/ui/security/SecurityAccessSIT.java =================================================================== --- trunk/pollen-ui-struts2-test/src/test/java/org/chorem/pollen/ui/security/SecurityAccessSIT.java 2012-06-12 16:12:48 UTC (rev 3454) +++ trunk/pollen-ui-struts2-test/src/test/java/org/chorem/pollen/ui/security/SecurityAccessSIT.java 2012-06-12 16:23:53 UTC (rev 3455) @@ -44,8 +44,7 @@ protected final String CONNECTEDREQUIRED_URL = "http://localhost:8080/pollen/security/connected_required"; protected final String ADMINREQUIRED_URL = "http://localhost:8080/pollen/security/admin_required"; protected final String POLL_BASE_URL = "http://localhost:8080/pollen/poll/votefor/"; - protected final String POLL_ADMIN_BASE_URL = "http://localhost:8080/pollen/poll/votefor/"; - protected final String MODIFICATION_BASE8URL = "http://localhost:8080/pollen/poll/modification/"; + protected final String POLL_MODIFICATION_BASE_URL = "http://localhost:8080/pollen/poll/modification/"; protected final String NORMALPOLL_ID = "c7082f9752844b83a1859abcae3b681c"; protected final String NORMALPOLL_ADMINTOKEN = "b9b434acd58d42fca083d473ee021fce"; protected final String POLLREQUIRED_URL = "http://localhost:8080/pollen/security/poll_required"; @@ -245,7 +244,8 @@ Assert.assertEquals(normalPollURL, driver.getCurrentUrl()); // try to access to poll page with bad pollId, current url should be the poll_required one - driver.get(normalPollURL.substring(0, 10)); + String badPollURL = POLL_BASE_URL + NORMALPOLL_ID.substring(0, 5); + driver.get(badPollURL); Assert.assertTrue(driver.getCurrentUrl().startsWith(POLLREQUIRED_URL)); // try to access to poll moderation page, current url should be good one @@ -259,12 +259,12 @@ Assert.assertTrue(driver.getCurrentUrl().startsWith(POLLACCESSREQUIRED_URL)); // try to access to poll moderation page, current url should be good one - String normalPollAdminURL = POLL_ADMIN_BASE_URL + NORMALPOLL_ID + ":" + NORMALPOLL_ADMINTOKEN; + String normalPollAdminURL = POLL_MODIFICATION_BASE_URL + NORMALPOLL_ID + ":" + NORMALPOLL_ADMINTOKEN; driver.get(normalPollAdminURL); Assert.assertEquals(normalPollAdminURL, driver.getCurrentUrl()); // try to access to poll page with bad pollId, current url should be the poll_required one - String badNormalPollAdminURL = POLL_ADMIN_BASE_URL + NORMALPOLL_ID + ":" + NORMALPOLL_ADMINTOKEN.substring(0, 2); + String badNormalPollAdminURL = POLL_MODIFICATION_BASE_URL + NORMALPOLL_ID + ":" + NORMALPOLL_ADMINTOKEN.substring(0, 2); driver.get(badNormalPollAdminURL); Assert.assertTrue(driver.getCurrentUrl().startsWith(POLLCREATORREQUIRED_URL));
participants (1)
-
ymartel@users.chorem.org