@Test public void shouldInitStockCardAndCreateAInitInventoryMovementItemWithLot() throws Exception { product.setArchived(false); InventoryViewModel model = new InventoryViewModelBuilder(product).setChecked(true).build(); initialInventoryPresenter.getInventoryViewModelList().add(model); initialInventoryPresenter.getDefaultViewModelList().add(model); initialInventoryPresenter.initOrArchiveBackStockCards(); ArgumentCaptor<StockMovementItem> argument = ArgumentCaptor.forClass(StockMovementItem.class); verify(stockRepositoryMock).addStockMovementAndUpdateStockCard(argument.capture()); }
void initOrArchiveBackStockCards() { defaultViewModelList.clear(); defaultViewModelList.addAll(inventoryViewModelList); for (InventoryViewModel inventoryViewModel : defaultViewModelList) { if (inventoryViewModel.isChecked()) { initOrArchiveBackStockCard(inventoryViewModel); } } }
InitialInventoryPresenter extends InventoryPresenter { void initOrArchiveBackStockCards() { defaultViewModelList.clear(); defaultViewModelList.addAll(inventoryViewModelList); for (InventoryViewModel inventoryViewModel : defaultViewModelList) { if (inventoryViewModel.isChecked()) { initOrArchiveBackStockCard(inventoryViewModel); } } } }
InitialInventoryPresenter extends InventoryPresenter { void initOrArchiveBackStockCards() { defaultViewModelList.clear(); defaultViewModelList.addAll(inventoryViewModelList); for (InventoryViewModel inventoryViewModel : defaultViewModelList) { if (inventoryViewModel.isChecked()) { initOrArchiveBackStockCard(inventoryViewModel); } } }  }
InitialInventoryPresenter extends InventoryPresenter { void initOrArchiveBackStockCards() { defaultViewModelList.clear(); defaultViewModelList.addAll(inventoryViewModelList); for (InventoryViewModel inventoryViewModel : defaultViewModelList) { if (inventoryViewModel.isChecked()) { initOrArchiveBackStockCard(inventoryViewModel); } } }  @Override Observable<List<InventoryViewModel>> loadInventory(); Observable<List<InventoryViewModel>> loadInventoryWithBasicProducts(); Observable<Object> initStockCardObservable(); void addNonBasicProductsToInventory(List<Product> nonBasicProducts); void filterViewModels(final String keyword); void removeNonBasicProductElement(InventoryViewModel model); }
InitialInventoryPresenter extends InventoryPresenter { void initOrArchiveBackStockCards() { defaultViewModelList.clear(); defaultViewModelList.addAll(inventoryViewModelList); for (InventoryViewModel inventoryViewModel : defaultViewModelList) { if (inventoryViewModel.isChecked()) { initOrArchiveBackStockCard(inventoryViewModel); } } }  @Override Observable<List<InventoryViewModel>> loadInventory(); Observable<List<InventoryViewModel>> loadInventoryWithBasicProducts(); Observable<Object> initStockCardObservable(); void addNonBasicProductsToInventory(List<Product> nonBasicProducts); void filterViewModels(final String keyword); void removeNonBasicProductElement(InventoryViewModel model); static final String EMPTY_STRING; }