PortfolioService { public Portfolio getPortfolio(String accountId) { logger.debug("Getting portfolio for accountId: " + accountId); List<Order> orders = repository.findByAccountId(accountId); Portfolio folio = new Portfolio(); folio.setAccountId(accountId); return createPortfolio(folio, orders); }  Portfolio getPortfolio(String accountId); @Transactional Order addOrder(Order order);  }
@Test public void doGetPortfolio() { when(repo.findByAccountId(ServiceTestConfiguration.ACCOUNT_ID)).thenReturn(ServiceTestConfiguration.orders()); when(quoteService.getQuotes(ServiceTestConfiguration.quote().getSymbol())).thenReturn(Collections.singletonList(ServiceTestConfiguration.quote())); Portfolio folio = service.getPortfolio(ServiceTestConfiguration.ACCOUNT_ID); }