StockMovementsPresenter extends Presenter { public void archiveStockCard() { stockCard.getProduct().setArchived(true); stockRepository.updateProductOfStockCard(stockCard.getProduct()); } StockMovementsPresenter(); @Override void attachView(BaseView v); void setStockCard(long stockCardId); void loadStockMovementViewModels(); void archiveStockCard();  }
@Test public void shouldArchiveStockCard() throws Exception { StockCard stockCard = stockMovementsPresenter.stockCard; stockCard.getProduct().setArchived(false); stockMovementsPresenter.archiveStockCard(); assertThat(stockCard.getProduct().isArchived()).isTrue(); verify(mockStockRepository).updateProductOfStockCard(stockCard.getProduct()); }