additional tests and content
This commit is contained in:
parent
3f8eddad33
commit
1842c33b3a
@ -11,7 +11,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<sec:authorize access="isAnonymous()">
|
||||
ANONYMOUS
|
||||
ANONYMOUS Content
|
||||
</sec:authorize>
|
||||
<sec:authorize access="isAuthenticated()">
|
||||
AUTHENTICATED Content
|
||||
@ -19,8 +19,7 @@
|
||||
Content for users who have the "ADMIN" role.
|
||||
</sec:authorize>
|
||||
<h2>
|
||||
principal.username:
|
||||
<sec:authentication property="principal.username" />
|
||||
Welcome back, <sec:authentication property="name" />
|
||||
</h2>
|
||||
<form>
|
||||
<sec:csrfInput />
|
||||
|
@ -28,7 +28,7 @@ public class HomeControllerTest {
|
||||
assertFalse(body.contains("ANONYMOUS"));
|
||||
|
||||
// test <sec:authorize access="isAuthenticated()">
|
||||
assertTrue(body.contains("AUTHENTICATED"));
|
||||
assertTrue(body.contains("AUTHENTICATED Content"));
|
||||
|
||||
// test <sec:authorize access="hasRole('ADMIN')">
|
||||
assertTrue(body.contains("Content for users who have the \"ADMIN\" role."));
|
||||
@ -52,9 +52,9 @@ public class HomeControllerTest {
|
||||
.getBody();
|
||||
|
||||
// test <sec:authorize access="isAnonymous()">
|
||||
assertTrue(body.contains("ANONYMOUS"));
|
||||
assertTrue(body.contains("ANONYMOUS Content"));
|
||||
|
||||
// test <sec:authorize access="isAuthenticated()">
|
||||
assertFalse(body.contains("AUTHENTICATED"));
|
||||
assertFalse(body.contains("AUTHENTICATED Content"));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user