File tree Expand file tree Collapse file tree 5 files changed +12
-4
lines changed
main/java/ru/mystamps/web
test/java/ru/mystamps/web/tests Expand file tree Collapse file tree 5 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ public final class Url {
76
76
public static final String JQUERY_JS = "/public/jquery/jquery.min.js" ;
77
77
public static final String CATALOG_UTILS_JS = "/public/js/CatalogUtils.js" ;
78
78
79
+ public static final String TOGGLZ_CONSOLE_PAGE = "/togglz" ;
80
+
79
81
private Url () {
80
82
}
81
83
Original file line number Diff line number Diff line change @@ -96,7 +96,9 @@ protected void configure(HttpSecurity http) throws Exception {
96
96
// Allow unsecured requests to Togglz and H2 consoles.
97
97
// See also: https://github.com/togglz/togglz/issues/119
98
98
// See also: src/main/config/test-override-web.xml
99
- .requireCsrfProtectionMatcher (new AllExceptUrlsStartedWith ("/togglz" , "/console" ))
99
+ .requireCsrfProtectionMatcher (
100
+ new AllExceptUrlsStartedWith (Url .TOGGLZ_CONSOLE_PAGE , "/console" )
101
+ )
100
102
.and ()
101
103
.rememberMe ()
102
104
// TODO: GH #27
Original file line number Diff line number Diff line change 22
22
import org .testng .annotations .BeforeClass ;
23
23
import org .testng .annotations .Test ;
24
24
25
+ import ru .mystamps .web .Url ;
25
26
import ru .mystamps .web .tests .page .ForbiddenErrorPage ;
26
27
27
28
import static ru .mystamps .web .tests .TranslationUtils .tr ;
@@ -38,7 +39,7 @@ public WhenAnonymousUserOpenTogglzConsole() {
38
39
39
40
@ BeforeClass
40
41
public void setUp () {
41
- page .open ("/togglz" );
42
+ page .open (Url . TOGGLZ_CONSOLE_PAGE );
42
43
}
43
44
44
45
@ Test (groups = "std" )
Original file line number Diff line number Diff line change 25
25
26
26
import org .springframework .beans .factory .annotation .Value ;
27
27
28
+ import ru .mystamps .web .Url ;
28
29
import ru .mystamps .web .tests .page .ForbiddenErrorPage ;
29
30
30
31
import static ru .mystamps .web .tests .TranslationUtils .tr ;
@@ -48,7 +49,7 @@ public WhenUserOpenTogglzConsole() {
48
49
@ BeforeClass
49
50
public void setUp () {
50
51
page .login (validUserLogin , validUserPassword );
51
- page .open ("/togglz" );
52
+ page .open (Url . TOGGLZ_CONSOLE_PAGE );
52
53
}
53
54
54
55
@ AfterClass (alwaysRun = true )
Original file line number Diff line number Diff line change 19
19
20
20
import org .openqa .selenium .WebDriver ;
21
21
22
+ import ru .mystamps .web .Url ;
23
+
22
24
public class ForbiddenErrorPage extends AbstractPage {
23
25
24
26
public ForbiddenErrorPage (WebDriver driver ) {
25
- super (driver , "/togglz" );
27
+ super (driver , Url . TOGGLZ_CONSOLE_PAGE );
26
28
}
27
29
28
30
public String getErrorMessage () {
You can’t perform that action at this time.
0 commit comments