@@ -0,0 +1,1822 @@
+package org.datacite.mds.web.ui.controller;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.datacite.mds.test.Utils;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.security.authentication.TestingAuthenticationToken;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.GrantedAuthority;%0Aimport org.springframework.security.core.context.SecurityContextHolder;%0Aimport org.springframework.security.web.authentication.switchuser.SwitchUserGrantedAuthority;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(%22/META-INF/spring/applicationContext.xml%22)%0A@Transactional%0Apublic class LogoutOrExitControllerTest %7B%0A    %0A    LogoutOrExitController controller = new LogoutOrExitController();%0A    %0A    @Test%0A    public void testNonSwitchedUser() %7B%0A        Utils.setUsernamePassword(%22foo%22, %22bar%22);%0A        String view = controller.logoutOrExit();%0A        Assert.assertEquals(%22redirect:/resources/j_spring_security_logout%22, view);%0A    %7D%0A%0A    @Test%0A    public void testSwitchedUser() %7B%0A        Authentication origAuthentication = new TestingAuthenticationToken(%22foo%22, %22bar%22);%0A        GrantedAuthority%5B%5D swichUserAuthority = %7B new SwitchUserGrantedAuthority(%22foobar%22, origAuthentication) %7D;%0A        %0A        Authentication switchedAuthentication = new TestingAuthenticationToken(%22foo%22, %22bar%22, swichUserAuthority);%0A        SecurityContextHolder.getContext().setAuthentication(switchedAuthentication);%0A        %0A        String view = controller.logoutOrExit();%0A        Assert.assertEquals(%22redirect:/resources/j_spring_security_exit_user%22, view);%0A    %7D%0A%7D%0A

add test for LogoutOrExitController