Search in sources :

Example 1 with EmployeeEffortsSpreadSheetBuildingStrategy

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

the class ManageEffortsBeanTest method testInitEmployeeEffortsSpreadSheet.

@Test
public void testInitEmployeeEffortsSpreadSheet() throws Exception {
    manageEffortsBean = new ManageEffortsBean();
    EmployeeService employeeService = mock(EmployeeService.class);
    EmployeeEffortsSpreadSheetBuildingStrategy strategy = createMock(EmployeeEffortsSpreadSheetBuildingStrategy.class);
    setField(strategy, "employeeService", employeeService);
    Filter filter = createMock(Filter.class);
    setField(manageEffortsBean, "grouping", BY_EMPLOYEES);
    setField(manageEffortsBean, "filterBean", filterBean);
    setField(manageEffortsBean, "employeeService", employeeService);
    expect(employeeService.getEffortsEmployees()).andReturn(Collections.emptyList());
    EasyMock.expect(filterBean.getCurrentFilter()).andReturn(filter);
    replay(employeeService, filterBean, strategy);
    SpreadSheet actual = manageEffortsBean.initSpreadSheet();
    verify(employeeService, filterBean, strategy);
    assertEquals(EmployeeEffortsSpreadSheet.class, actual.getClass());
}
Also used : EmployeeEffortsSpreadSheetBuildingStrategy(com.artezio.arttime.web.spread_sheet.strategies.EmployeeEffortsSpreadSheetBuildingStrategy) 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) 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 EmployeeEffortsSpreadSheetBuildingStrategy (com.artezio.arttime.web.spread_sheet.strategies.EmployeeEffortsSpreadSheetBuildingStrategy)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1