@Test
    @Transactional
    public void testFullCycle() throws Exception {
        QuoteProvider provider = new DummyQuoteProvider(quoteEngine.registerProvider(Symbol.EURUSD));
        executorService.submit((Runnable) quoteEngine);
        executorService.submit((Runnable) provider);

        long nTrials = 2;
        PeriodType.M1.getTimeUnit().sleep(nTrials * PeriodType.M1.getDelay() + 1);

        executorService.shutdown();

        Collection<TrendBar> allBars = trendBarDao.getAllBars(Symbol.EURUSD, PeriodType.M1);
        assertNotNull(allBars);
        assertEquals(nTrials, allBars.size());
        for (TrendBar trendBar : allBars) {
            assertEquals(dummy.getPrice(), trendBar.getOpenPrice());
            assertEquals(dummy.getPrice(), trendBar.getClosePrice());
            assertEquals(dummy.getPrice(), trendBar.getLowPrice());
            assertEquals(dummy.getPrice(), trendBar.getHighPrice());
            assertTrue(System.currentTimeMillis() > trendBar.getTimestamp());
        }

        Collection<TrendBar> hoursBars = trendBarDao.getAllBars(Symbol.EURUSD, PeriodType.H1);
        assertTrue(hoursBars.isEmpty());
    }