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