Commit 0961e85a authored by Artem Hrybeniuk's avatar Artem Hrybeniuk
Browse files

Added Lazyloading of OrderRequestItem for OrderRequestServiceImpl.addInventories

parent 807fac81
......@@ -326,6 +326,8 @@ public class OrderRequestServiceImpl extends FilteredCRUDServiceImpl<OrderReques
return itemRepository.save(item);
}).collect(Collectors.toList());
items.forEach(OrderRequestItem::lazyLoad);
LOG.debug("Done saving {} items.", items.size());
return items;
}
......
......@@ -891,6 +891,12 @@ public class OrderRequestControllerTest extends AbstractApiV1Test {
.andExpect(jsonPath("$", hasSize(2)))
.andExpect(jsonPath("$.[0].statusCode", is(CommunityCodeValues.ORDER_REQUEST_ITEM_STATUS_NEW.value)))
.andExpect(jsonPath("$.[1].statusCode", is(CommunityCodeValues.ORDER_REQUEST_ITEM_STATUS_NEW.value)))
.andExpect(jsonPath("$.[0].inventory", is(notNullValue())))
.andExpect(jsonPath("$.[1].inventory", is(notNullValue())))
.andExpect(jsonPath("$.[0].inventory.accession", is(notNullValue())))
.andExpect(jsonPath("$.[1].inventory.accession", is(notNullValue())))
.andExpect(jsonPath("$.[0].inventory.accession.id", is(accession.getId().intValue())))
.andExpect(jsonPath("$.[1].inventory.accession", is(accession.getId().intValue())))
;
/*@formatter:on*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment