FileBasedSnapshotStore implements ConstructableSnapshotStore, ReceivableSnapshotStore { @Override public void delete() { currentPersistedSnapshotRef.set(null); try { LOGGER.debug("DELETE FOLDER {}", snapshotsDirectory); FileUtil.deleteFolder(snapshotsDirectory); } catch (final IOException e) { throw new UncheckedIOException(e); } try { LOGGER.debug("DELETE FOLDER {}", pendingDirectory); FileUtil.deleteFolder(pendingDirectory); } catch (final IOException e) { throw new UncheckedIOException(e); } } FileBasedSnapshotStore(
      final SnapshotMetrics snapshotMetrics,
      final Path snapshotsDirectory,
      final Path pendingDirectory); @Override boolean hasSnapshotId(final String id); @Override Optional<PersistedSnapshot> getLatestSnapshot(); @Override void purgePendingSnapshots(); @Override void addSnapshotListener(final PersistedSnapshotListener listener); @Override void removeSnapshotListener(final PersistedSnapshotListener listener); @Override long getCurrentSnapshotIndex(); @Override void delete(); @Override ReceivedSnapshot newReceivedSnapshot(final String snapshotId); @Override Optional<TransientSnapshot> newTransientSnapshot(
      final long index,
      final long term,
      final long processedPosition,
      final long exportedPosition); Path getPath(); @Override void close();  }
@Test public void shouldDeleteStore() { factory.getPersistedSnapshotStore(partitionName).delete(); assertThat(pendingSnapshotsDir).doesNotExist(); assertThat(snapshotsDir).doesNotExist(); }