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());
}
Aggregations