@@ -0,0 +1,1686 @@
+package com.alcedomoreno.sirme.business.rest;%0A%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport com.alcedomoreno.sirme.business.data.Report;%0Aimport com.alcedomoreno.sirme.business.dto.ReportDTO;%0Aimport com.alcedomoreno.sirme.business.services.QuestionService;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class QuestionRestControllerTest extends TestCase %7B%0A%0A%0A%09@InjectMocks%0A%09private QuestionsRestController questionRestController;%0A%09%0A%09@Mock%0A%09QuestionService questionService;%0A%0A%09@Test%0A%09public void testAllTheReports()%7B%0A%09%09try %7B%0A%09%09%09when(questionService.getAllWithQuestions()).thenReturn(getDummyReports());%0A%09%09%09Collection%3CReportDTO%3E allReports = questionRestController.getAllQuestionsGroups();%0A%09%09%09assertEquals(allReports.size(), 10);%0A%09%09%7D catch (Exception e)%7B%0A%09%09%09fail(e.getMessage());%0A%09%09%7D%0A    %7D%0A%09%0A%09@Test%0A%09public void testAllTheReportsException()%7B%0A%09%0A%09%09try%7B%0A%09%09%09when(questionService.getAllWithQuestions()).thenThrow(Exception.class);%0A%09%09%09questionRestController.getAllQuestionsGroups();%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09fail(e.getMessage());%0A%09%09%7D%0A%09%09assertTrue(true);%0A    %7D%0A%09%0A%09private Collection%3CReport%3E getDummyReports()%7B%0A%09%09Collection%3CReport%3E reports = new ArrayList%3CReport%3E();%0A%09%09%0A%09%09for (int i = 0 ; i %3C 10 ; i++)%7B%0A%09%09%09Report report = new Report();%0A%09%09%09%0A%09%09%09report.setIdReport(i);%0A%09%09%09report.setNameReport(%22NAME_%22 + i);%0A%09%09%09report.setTitleReport(%22TITLE_%22 + i);%0A%09%09%09report.setFileReport(%22FILE_%22 + i);%0A%09%09%09%0A%09%09%09reports.add(report);%0A%09%09%7D%0A%09%09%0A%09%09return reports;%0A%09%7D%0A%09%0A%7D%0A

Create QuestionRestControllerTest.java