use of org.openlmis.stockmanagement.dto.PhysicalInventoryLineItemDto in project openlmis-stockmanagement by OpenLMIS.
the class PhysicalInventoryValidatorTest method shouldRejectWhenLineItemHasNoOrderable.
@Test(expected = ValidationMessageException.class)
public void shouldRejectWhenLineItemHasNoOrderable() {
// given
PhysicalInventoryDto inventory = newInventory();
inventory.setLineItems(Collections.singletonList(new PhysicalInventoryLineItemDto()));
doNothing().when(vvmValidator).validate(eq(inventory.getLineItems()), anyString(), eq(false));
// when
validator.validateDraft(inventory, inventory.getId());
// then
verify(vvmValidator, atLeastOnce()).validate(eq(inventory.getLineItems()), anyString(), eq(false));
}
use of org.openlmis.stockmanagement.dto.PhysicalInventoryLineItemDto in project openlmis-stockmanagement by OpenLMIS.
the class PhysicalInventoryServiceTest method verifyLineItems.
private void verifyLineItems(List<PhysicalInventoryLineItemDto> expected, List<PhysicalInventoryLineItem> actual) {
PhysicalInventoryLineItemDto lineItemDto = expected.get(0);
PhysicalInventoryLineItem lineItem = actual.get(0);
assertThat(lineItem.getQuantity(), is(lineItemDto.getQuantity()));
assertThat(lineItem.getOrderableId(), is(lineItemDto.getOrderableId()));
}
Aggregations