minor formatting cleanup
This commit is contained in:
parent
58bf2bf3ea
commit
fd32feeed3
|
@ -27,8 +27,7 @@ public class LoggerInterceptor extends HandlerInterceptorAdapter {
|
|||
* Executed before after handler is executed
|
||||
**/
|
||||
@Override
|
||||
public void postHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler,
|
||||
final ModelAndView modelAndView) throws Exception {
|
||||
public void postHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler, final ModelAndView modelAndView) throws Exception {
|
||||
log.info("[postHandle][" + request + "]");
|
||||
}
|
||||
|
||||
|
@ -36,8 +35,7 @@ public class LoggerInterceptor extends HandlerInterceptorAdapter {
|
|||
* Executed after complete request is finished
|
||||
**/
|
||||
@Override
|
||||
public void afterCompletion(final HttpServletRequest request, final HttpServletResponse response, final Object handler, final Exception ex)
|
||||
throws Exception {
|
||||
public void afterCompletion(final HttpServletRequest request, final HttpServletResponse response, final Object handler, final Exception ex) throws Exception {
|
||||
if (ex != null)
|
||||
ex.printStackTrace();
|
||||
log.info("[afterCompletion][" + request + "][exception: " + ex + "]");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.baeldung.security;
|
||||
|
||||
|
||||
import org.baeldung.security.csrf.CsrfDisabledIntegrationTest;
|
||||
import org.baeldung.security.csrf.CsrfEnabledIntegrationTest;
|
||||
import org.junit.runner.RunWith;
|
||||
|
|
|
@ -31,10 +31,8 @@ public class CsrfDisabledIntegrationTest extends CsrfAbstractIntegrationTest {
|
|||
|
||||
@Test
|
||||
public void accessOtherPages() throws Exception {
|
||||
mvc.perform(get("/auth/transfer").contentType(MediaType.APPLICATION_JSON).param("accountNo", "1").param("amount", "100"))
|
||||
.andExpect(status().isUnauthorized()); // without authorization
|
||||
mvc.perform(get("/auth/transfer").contentType(MediaType.APPLICATION_JSON).param("accountNo", "1").param("amount", "100").with(testUser()))
|
||||
.andExpect(status().isOk()); // with authorization
|
||||
mvc.perform(get("/auth/transfer").contentType(MediaType.APPLICATION_JSON).param("accountNo", "1").param("amount", "100")).andExpect(status().isUnauthorized()); // without authorization
|
||||
mvc.perform(get("/auth/transfer").contentType(MediaType.APPLICATION_JSON).param("accountNo", "1").param("amount", "100").with(testUser())).andExpect(status().isOk()); // with authorization
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue