Commit 8d28268059908bd18e543da7cec6f2ac320f90cf

Authored by Julien Iguchi-Cartigny
1 parent 5e965ce4

fixing tests with servlet path

src/test/java/fr/plil/sio/web/mvc/CheckUserInterceptorTest.java
... ... @@ -22,25 +22,24 @@ public class CheckUserInterceptorTest {
22 22 request = new MockHttpServletRequest();
23 23 response = new MockHttpServletResponse();
24 24 }
25   -/*
  25 +
26 26 @Test
27 27 public void checkPreHandleServletPathIsLogin() throws IOException {
28   - request.setPathInfo("/login");
  28 + request.setServletPath("/login");
29 29 assertTrue(interceptor.preHandle(request, response, null));
30 30 }
31 31  
32 32 @Test
33 33 public void checkPreHandleUsernameInSession() throws IOException {
34 34 userSession.setUsername("admin");
35   - request.setPathInfo("/blabla");
  35 + request.setServletPath("/blabla");
36 36 assertTrue(interceptor.preHandle(request, response, null));
37 37 }
38 38  
39 39 @Test
40 40 public void checkPreHandleUsernameNotInSession() throws IOException {
41   - request.setPathInfo("/blabla");
  41 + request.setServletPath("/blabla");
42 42 assertFalse(interceptor.preHandle(request, response, null));
43 43 assertEquals(response.getRedirectedUrl(),"login");
44 44 }
45   - */
46 45 }
... ...