Holding holding = holdingDataOnDemand.getNewTransientHolding(100);
holding.setPurchasedate(new java.sql.Date(System.currentTimeMillis()));
tradingService.saveHolding(holding);
entityManager.flush();
entityManager.clear(); // force reload
Quote quote = new Quote();
quote.setSymbol("quoteSymbol_100");
quote.setPrice(BigDecimal.valueOf(50.00));
quote.setChange1(BigDecimal.valueOf(5.00));
quote.setVolume( BigDecimal.valueOf(50000));
quoteService.saveQuote(quote);
entityManager.flush();
entityManager.clear(); // force reload
Assert.assertNotNull("Expected 'Quote' identifier to no longer be null", quote.getQuoteid());
PortfolioSummary portfolioSummary = tradingService.findPortfolioSummary(100);
Assert.assertTrue("Expected 'PortfolioSummary' holding count to be equal to 1", portfolioSummary.getNumberOfHoldings() == 1);
}