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