minor formatting cleanup

This commit is contained in:
eugenp 2016-08-22 12:35:23 +03:00
parent 58bf2bf3ea
commit fd32feeed3
11 changed files with 289 additions and 294 deletions

View File

@ -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 + "]");

View File

@ -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;

View File

@ -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