/** * {@inheritDoc} */ @Override public void run() { while (true) { TimerData timerData = this.mostRecentlyAdded; if (timerData != null) { if (timerData == lastChecked) { // NOPMD this.timerDataAggregator.removeAndPersistAll(); } lastChecked = timerData; } this.timerDataAggregator.saveAllInPersistList(); try { Thread.sleep(this.timerDataAggregator.cacheCleanSleepingPeriod); } catch (InterruptedException e) { Thread.interrupted(); } } }
aggregator.removeAndPersistAll(); verify(entityManager, timeout(10000).times(2)).persist(argThat(new ArgumentMatcher<TimerData>() { @Override