LoginController extends AbstractUserAndContractsController { @GetMapping(value = {LOGIN_URL, "/"}) public String displayLoginPage () { return (isAuthenticated())? HOME_VIEW_REDIRECT_NAME: LOGIN_VIEW_NAME; }  @GetMapping(value = {LOGIN_URL, "/"}) String displayLoginPage(); @GetMapping(value = ACCESS_DENIED_URL) String displayAccessDeniedPage();  }
@Test public void testDisplayLoginPage() { setUpMockAuthenticationContext(false); assertEquals(LOGIN_VIEW_NAME, instance.displayLoginPage()); }
@Test public void testHomePageWhenAlreadyAuthenticatedDisplayLoginPage() { setUpMockAuthenticationContext(true); assertEquals(HOME_VIEW_REDIRECT_NAME, instance.displayLoginPage()); }