This commit is contained in:
Stephane Nicoll
2017-12-12 11:57:24 +01:00
parent 97c91eee94
commit 23218add90
615 changed files with 2832 additions and 3224 deletions

View File

@@ -57,24 +57,24 @@ public class SampleSecureApplicationTests {
}
@Test(expected = AuthenticationException.class)
public void secure() throws Exception {
public void secure() {
assertThat("Hello Security").isEqualTo(this.service.secure());
}
@Test
public void authenticated() throws Exception {
public void authenticated() {
SecurityContextHolder.getContext().setAuthentication(this.authentication);
assertThat("Hello Security").isEqualTo(this.service.secure());
}
@Test
public void preauth() throws Exception {
public void preauth() {
SecurityContextHolder.getContext().setAuthentication(this.authentication);
assertThat("Hello World").isEqualTo(this.service.authorized());
}
@Test(expected = AccessDeniedException.class)
public void denied() throws Exception {
public void denied() {
SecurityContextHolder.getContext().setAuthentication(this.authentication);
assertThat("Goodbye World").isEqualTo(this.service.denied());
}