Search in sources :

Example 1 with ProjectEffortsSpreadSheetBuildingStrategy

use of com.artezio.arttime.web.spread_sheet.strategies.ProjectEffortsSpreadSheetBuildingStrategy in project ART-TIME by Artezio.

the class ManageEffortsBeanTest method testInitProjectEffortsSpreadSheet.

@Test
public void testInitProjectEffortsSpreadSheet() throws Exception {
    manageEffortsBean = new ManageEffortsBean();
    ProjectEffortsSpreadSheetBuildingStrategy strategy = createMock(ProjectEffortsSpreadSheetBuildingStrategy.class);
    EmployeeService employeeService = mock(EmployeeService.class);
    setField(strategy, "employeeService", employeeService);
    Filter filter = createMock(Filter.class);
    setField(manageEffortsBean, "grouping", BY_PROJECTS);
    setField(manageEffortsBean, "filterBean", filterBean);
    setField(manageEffortsBean, "employeeService", employeeService);
    EasyMock.expect(filterService.getActiveProjectsFilter()).andReturn(filter);
    EasyMock.expect(filterBean.getCurrentFilter()).andReturn(filter);
    expect(employeeService.getEffortsEmployees()).andReturn(Collections.emptyList());
    replay(employeeService, filterBean, strategy);
    SpreadSheet actual = manageEffortsBean.initSpreadSheet();
    verify(employeeService, filterBean, strategy);
    assertEquals(ProjectEffortsSpreadSheet.class, actual.getClass());
}
Also used : Filter(com.artezio.arttime.filter.Filter) SpreadSheet(com.artezio.arttime.web.spread_sheet.SpreadSheet) EmployeeEffortsSpreadSheet(com.artezio.arttime.web.spread_sheet.EmployeeEffortsSpreadSheet) ProjectEffortsSpreadSheet(com.artezio.arttime.web.spread_sheet.ProjectEffortsSpreadSheet) ProjectEffortsSpreadSheetBuildingStrategy(com.artezio.arttime.web.spread_sheet.strategies.ProjectEffortsSpreadSheetBuildingStrategy) EmployeeService(com.artezio.arttime.services.EmployeeService) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

Filter (com.artezio.arttime.filter.Filter)1 EmployeeService (com.artezio.arttime.services.EmployeeService)1 EmployeeEffortsSpreadSheet (com.artezio.arttime.web.spread_sheet.EmployeeEffortsSpreadSheet)1 ProjectEffortsSpreadSheet (com.artezio.arttime.web.spread_sheet.ProjectEffortsSpreadSheet)1 SpreadSheet (com.artezio.arttime.web.spread_sheet.SpreadSheet)1 ProjectEffortsSpreadSheetBuildingStrategy (com.artezio.arttime.web.spread_sheet.strategies.ProjectEffortsSpreadSheetBuildingStrategy)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1