Blame view

src/test/java/fr/plil/sio/web/mvc/LogoutControllerTest.java 535 Bytes
aa193b2b   Julien Iguchi-Cartigny   First version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  package fr.plil.sio.web.mvc;
  
  import static org.junit.Assert.*;
  import org.junit.Test;
  
  public class LogoutControllerTest {
  
      @Test
      public void testGetLogout() {
          LogoutController logoutController = new LogoutController();
          UserSession userSession = new UserSession();
          userSession.setUsername("blabla");
          logoutController.setUserSession(userSession);
          String view = logoutController.getLogout();
          assertNull(userSession.getUsername());
          assertEquals("redirect:/",view);
      }
  }