use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeDataSetTest method testOpen.
@Test
public void testOpen() throws IllegalAccessException {
Map<String, Object> parameters = new HashMap<>();
parameters.put(REPORT_PARAM_NAME_HOUR_TYPE_IDS, new Long[] { 1L, 3L });
dataSet.open(null, parameters);
Iterator<HourType> actual = (Iterator) FieldUtils.readField(dataSet, "dataIterator", true);
List<HourType> hourTypes = new SampleDataRepository().getHourTypes();
List<HourType> expected = Arrays.asList(hourTypes.get(0), hourTypes.get(2));
ListAssert.assertEquals(expected, IteratorUtils.toList(actual));
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypesBeanTest method testSetActualTime.
@Test
public void testSetActualTime() throws NoSuchFieldException {
HourType hourType = new HourType();
setField(bean, "hourTypes", new ArrayList<HourType>());
setField(bean, "hourTypeService", hourTypeService);
expect(hourTypeService.setActualTime(hourType)).andReturn(hourType);
replay(hourTypeService);
bean.setActualTime(hourType);
verify(hourTypeService);
assertNull(getField(bean, "hourTypes"));
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypesBeanTest method testCreate.
@Test
public void testCreate() throws NoSuchFieldException {
setField(bean, "hourTypeService", hourTypeService);
HourType hourType = new HourType();
expect(hourTypeService.create(hourType)).andReturn(hourType);
replay(hourTypeService);
bean.create(hourType);
verify(hourTypeService);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypesBeanTest method testUpdate.
@Test
public void testUpdate() throws NoSuchFieldException {
setField(bean, "hourTypeService", hourTypeService);
HourType hourType = new HourType();
expect(hourTypeService.update(hourType)).andReturn(hourType);
replay(hourTypeService);
bean.update(hourType);
verify(hourTypeService);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypesBeanTest method testRemove.
@Test
public void testRemove() throws ActualTimeRemovalException, NoSuchFieldException {
setField(bean, "hourTypeService", hourTypeService);
HourType hourType = new HourType();
hourTypeService.remove(hourType);
replay(hourTypeService);
bean.remove(hourType);
verify(hourTypeService);
}
Aggregations