@@ -0,0 +1,2828 @@
+package org.datacite.mds.web.ui.controller;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.datacite.mds.domain.Datacentre;%0Aimport org.datacite.mds.domain.Dataset;%0Aimport org.datacite.mds.service.HandleException;%0Aimport org.datacite.mds.service.HandleService;%0Aimport org.datacite.mds.test.TestUtils;%0Aimport org.datacite.mds.validation.ValidationHelper;%0Aimport org.datacite.mds.web.ui.model.CreateDatasetModel;%0Aimport org.easymock.EasyMock;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%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;%0Aimport org.springframework.validation.BeanPropertyBindingResult;%0Aimport org.springframework.validation.BindingResult;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(%22/META-INF/spring/applicationContext.xml%22)%0A@Transactional%0Apublic class DatasetControllerTest %7B%0A    %0A    Datacentre datacentre;%0A    %0A    DatasetController controller;%0A%0A    @Autowired%0A    ValidationHelper validationHelper;%0A    %0A    private HandleService mockHandleService;%0A    %0A    CreateDatasetModel createDatasetModel;%0A    BindingResult result;%0A    Model model;%0A    %0A    %0A    @Before%0A    public void init() %7B%0A        controller = new DatasetController();%0A        controller.validationHelper = validationHelper;%0A        %0A        mockHandleService = EasyMock.createMock(HandleService.class);%0A        controller.handleService = mockHandleService;%0A        expectNoHandleServiceCall();%0A        %0A        datacentre = TestUtils.createDefaultDatacentre(%2210.5072%22);%0A        TestUtils.login(datacentre);%0A        %0A        createDatasetModel = new CreateDatasetModel();%0A        createDatasetModel.setDatacentre(datacentre);%0A        result = new BeanPropertyBindingResult(createDatasetModel, %22createDatasetModel%22);%0A        model = new ExtendedModelMap();%0A    %7D%0A    %0A    private void expectNoHandleServiceCall() %7B%0A        EasyMock.reset(mockHandleService);%0A        EasyMock.replay(mockHandleService);%0A    %7D%0A%0A    @After%0A    public void verify() %7B%0A        EasyMock.verify(mockHandleService);%0A    %7D%0A%0A    @Test%0A    public void createEmptyForm() %7B%0A        String view = controller.create(createDatasetModel, result, model);%0A        assertEquals(%22datasets/create%22, view);%0A        assertEquals(0, Dataset.countDatasets());%0A    %7D%0A    %0A    private void expectHandleServiceCreate(String doi, String url) throws HandleException %7B%0A        EasyMock.reset(mockHandleService);%0A        mockHandleService.create(doi, url);%0A        EasyMock.replay(mockHandleService);%0A    %7D%0A%0A%7D%0A

add test skeleton for DatasetController