CreateSnapshotTaskRunner extends SpaceModifyingSnapshotTaskRunner { protected String generateSnapshotId(String spaceId, long timestamp) { SnapshotIdentifier snapshotIdentifier = new SnapshotIdentifier(dcAccountName, dcStoreId, spaceId, timestamp); return snapshotIdentifier.getSnapshotId(); } CreateSnapshotTaskRunner(StorageProvider snapshotProvider,
                                    SnapshotStorageProvider unwrappedSnapshotProvider,
                                    String dcHost,
                                    String dcPort,
                                    String dcStoreId,
                                    String dcAccountName,
                                    String dcSnapshotUser,
                                    String bridgeAppHost,
                                    String bridgeAppPort,
                                    String bridgeAppUser,
                                    String bridgeAppPass,
                                    String bridgeMemberId); @Override String getName(); @Override String performTask(String taskParameters);  }
@Test public void testGenerateSnapshotId() { replayMocks(); String spaceId = "space-id"; long timestamp = System.currentTimeMillis(); String snapshotId = taskRunner.generateSnapshotId(spaceId, timestamp); String delim = SnapshotIdentifier.DELIM; String expectedSnapshotId = dcAccountName + delim + dcStoreId + delim + spaceId + delim; assertTrue(snapshotId.startsWith(expectedSnapshotId)); assertTrue(snapshotId.endsWith(DateUtil.convertToStringPlain(timestamp))); }