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