@@ -0,0 +1,2354 @@
+package org.datacite.mds.web.ui.controller;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.datacite.mds.domain.Allocator;%0Aimport org.datacite.mds.domain.Datacentre;%0Aimport org.datacite.mds.test.Utils;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.transaction.annotation.Transactional;%0Aimport org.springframework.ui.ExtendedModelMap;%0Aimport org.springframework.ui.Model;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(%22/META-INF/spring/applicationContext.xml%22)%0A@Transactional%0Apublic class UserInfoControllerTest %7B%0A    %0A    UserInfoController controller = new UserInfoController();%0A%0A    Allocator allocator;%0A    Datacentre datacentre;%0A%0A    Model model;%0A%0A    @Before%0A    public void init() %7B%0A        allocator = Utils.createAllocator(%22AL%22);%0A        allocator.persist();%0A        datacentre = Utils.createDatacentre(%22AL.DC%22, allocator);%0A        datacentre.persist();%0A        model = new ExtendedModelMap();%0A    %7D%0A    %0A    @Test%0A    public void userinfoAllocator() %7B%0A        Utils.login(allocator);%0A        String view = controller.userinfo(model);%0A        Assert.assertEquals(%22userinfo%22, view);%0A        checkModelAttributeAllocator();%0A        Assert.assertFalse(model.containsAttribute(%22datacentre%22));%0A    %7D%0A%0A    @Test%0A    public void userinfoDatacentre() %7B%0A        Utils.login(datacentre);%0A        String view = controller.userinfo(model);%0A        Assert.assertEquals(%22userinfo%22, view);%0A        checkModelAttributeAllocator();%0A        checkModelAttributeDatacentre();%0A    %7D%0A    %0A    @Test%0A    public void userinfoNotLoggedIn() %7B%0A        Utils.login(null);%0A        String view = controller.userinfo(model);%0A        Assert.assertEquals(%22userinfo%22, view);%0A        Assert.assertTrue(model.asMap().isEmpty());%0A    %7D%0A    %0A    void checkModelAttributeAllocator() %7B%0A        Allocator modelAllocator = (Allocator) model.asMap().get(%22allocator%22);%0A        Assert.assertEquals(allocator.getSymbol(), modelAllocator.getSymbol());%0A    %7D%0A    %0A    void checkModelAttributeDatacentre() %7B%0A        Datacentre modelDatacentre = (Datacentre) model.asMap().get(%22datacentre%22);%0A        Assert.assertEquals(datacentre.getSymbol(), modelDatacentre.getSymbol());%0A    %7D%0A    %0A%7D%0A

add test for UserInfoController