RestoreSnapshotTaskRunner extends AbstractSnapshotTaskRunner { protected void checkExistingRestore(SnapshotIdentifier snapshotIdentifier) { Iterator<String> currentSpaces = snapshotProvider.getSpaces(); while (currentSpaces.hasNext()) { String spaceId = currentSpaces.next(); if (spaceId.equals(snapshotIdentifier.getRestoreSpaceId())) { String error = "A request to restore snapshot with ID " + snapshotIdentifier.getSnapshotId() + " has been made previously. The snapshot is " + "being restored to space: " + spaceId; throw new TaskException(error); } } } RestoreSnapshotTaskRunner(StorageProvider snapshotProvider,
                                     SnapshotStorageProvider unwrappedSnapshotProvider,
                                     String dcHost,
                                     String dcPort,
                                     String dcStoreId,
                                     String dcSnapshotUser,
                                     String bridgeAppHost,
                                     String bridgeAppPort,
                                     String bridgeAppUser,
                                     String bridgeAppPass); @Override String getName(); @Override String performTask(String taskParameters);  }
@Test public void testCheckExistingRestore() { replayMocks(); }