SyncProcessManagerImpl implements SyncProcessManager { @Override public void resume() throws SyncProcessException { this.currentState.resume(); } @Autowired  SyncProcessManagerImpl(
        SyncConfigurationManager syncConfigurationManager,
        ContentStoreManagerFactory contentStoreManagerFactory,
        SyncOptimizeManager syncOptimizeManager); @PostConstruct void init(); @Override SyncProcessError getError(); @Override void clearError(); @Override void start(); @Override void resume(); @Override void stop(); @Override void pause(); @Override void restart(); @Override SyncProcessState getProcessState(); @Override SyncProcessStats getProcessStats(); @Override void addSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener); @Override void removeSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener); @Override List<MonitoredFile> getMonitoredFiles(); @Override List<SyncSummary> getFailures(); @Override List<SyncSummary> getRecentlyCompleted(); @Override List<File> getQueuedFiles(); @Override void clearFailures(); @PreDestroy void shutdown();  }
@Test public void testResume() throws Exception { setupStart(2); replay(); createTestSubject(); TestSyncStateListener[] listeners = { new TestSyncStateListener(SyncProcessState.RUNNING), new TestSyncStateListener(SyncProcessState.PAUSING), new TestSyncStateListener(SyncProcessState.PAUSED), new TestSyncStateListener(SyncProcessState.RESUMING), new TestSyncStateListener(SyncProcessState.RUNNING) }; for (TestSyncStateListener listener : listeners) { syncProcessManagerImpl.addSyncStateChangeListener(listener); } syncProcessManagerImpl.start(); int i = -1; assertTrue(listeners[++i].success()); syncProcessManagerImpl.pause(); assertTrue(listeners[++i].success()); assertTrue(listeners[++i].success()); syncProcessManagerImpl.resume(); assertTrue(listeners[++i].success()); assertTrue(listeners[++i].success()); Thread.sleep(1000); }