use of de.metas.ui.web.window.model.lookup.NullLookupDataSource in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewRepositoryTests method createPickingSllotViewRepository.
private PickingSlotViewRepository createPickingSllotViewRepository() {
final NullLookupDataSource nullDs = NullLookupDataSource.instance;
final PickingSlotViewRepository pickingSlotViewRepository = new PickingSlotViewRepository(pickingHUsRepo, () -> nullDs, () -> nullDs, () -> nullDs);
return pickingSlotViewRepository;
}
use of de.metas.ui.web.window.model.lookup.NullLookupDataSource in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewRepositoryTests method testRetrievePickingSlotRows_No_HUs_show_PickingSlotsOnly.
/**
* Verifies {@link PickingSlotViewRepository#retrieveRows(PickingSlotRepoQuery)}<br>
* when there are no HUs (no picking candidates) assigned to a picking slot, but still the picking slot itself shall be shown.
*/
@Test
public void testRetrievePickingSlotRows_No_HUs_show_PickingSlotsOnly() {
final I_M_ShipmentSchedule shipmentSchedule = newInstance(I_M_ShipmentSchedule.class);
save(shipmentSchedule);
final I_M_PickingSlot pickingSlot = newInstance(I_M_PickingSlot.class);
pickingSlot.setIsPickingRackSystem(true);
save(pickingSlot);
final PickingSlotRepoQuery query = PickingSlotRepoQuery.of(shipmentSchedule.getM_ShipmentSchedule_ID());
// @formatter:off return an empty list
new Expectations() {
{
pickingHUsRepo.retrievePickedHUsIndexedByPickingSlotId(query);
result = ImmutableListMultimap.of();
}
};
// @formatter:on
final NullLookupDataSource nullDS = NullLookupDataSource.instance;
final PickingSlotViewRepository pickingSlotViewRepository = new PickingSlotViewRepository(pickingHUsRepo, () -> nullDS, () -> nullDS, () -> nullDS);
final List<PickingSlotRow> pickingSlotRows = pickingSlotViewRepository.retrievePickingSlotRows(query);
// even if there are no HUs, there shall still be a row for our picking slot.
assertThat(pickingSlotRows.size(), is(1));
final PickingSlotRow pickingSlotRow = pickingSlotRows.get(0);
assertThat(pickingSlotRow.getType()).isEqualTo(PickingSlotRowType.forPickingSlotRow());
}
Aggregations