SEC-2944: Polish

This commit is contained in:
Rob Winch 2015-04-30 10:00:04 -05:00
parent 3099f92154
commit a67ef1c3a2

View File

@ -15,7 +15,7 @@
*/ */
package org.springframework.security.web.authentication.logout; package org.springframework.security.web.authentication.logout;
import static org.junit.Assert.*; import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import org.junit.Assert; import org.junit.Assert;
@ -39,10 +39,10 @@ public class HttpStatusReturningLogoutSuccessHandlerTests {
lsh.onLogoutSuccess(request, response, mock(Authentication.class)); lsh.onLogoutSuccess(request, response, mock(Authentication.class));
assertNull(request.getSession(false)); assertThat(request.getSession(false)).isNull();
assertNull(response.getRedirectedUrl()); assertThat(response.getRedirectedUrl()).isNull();
assertNull(response.getForwardedUrl()); assertThat(response.getForwardedUrl()).isNull();
assertEquals(HttpStatus.OK.value(), response.getStatus()); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
} }
@Test @Test
@ -54,10 +54,10 @@ public class HttpStatusReturningLogoutSuccessHandlerTests {
lsh.onLogoutSuccess(request, response, mock(Authentication.class)); lsh.onLogoutSuccess(request, response, mock(Authentication.class));
assertNull(request.getSession(false)); assertThat(request.getSession(false)).isNull();
assertNull(response.getRedirectedUrl()); assertThat(response.getRedirectedUrl()).isNull();
assertNull(response.getForwardedUrl()); assertThat(response.getForwardedUrl()).isNull();
assertEquals(HttpStatus.NO_CONTENT.value(), response.getStatus()); assertThat(response.getStatus()).isEqualTo(HttpStatus.NO_CONTENT.value());
} }
@Test @Test
@ -67,7 +67,7 @@ public class HttpStatusReturningLogoutSuccessHandlerTests {
new HttpStatusReturningLogoutSuccessHandler(null); new HttpStatusReturningLogoutSuccessHandler(null);
} }
catch (IllegalArgumentException e) { catch (IllegalArgumentException e) {
assertEquals("The provided HttpStatus must not be null.", e.getMessage()); assertThat(e).hasMessage("The provided HttpStatus must not be null.");
return; return;
} }