SnapshotTaskClientImpl implements SnapshotTaskClient { @Override public CreateSnapshotTaskResult createSnapshot(String spaceId, String description, String userEmail) throws ContentStoreException { CreateSnapshotTaskParameters taskParams = new CreateSnapshotTaskParameters(); taskParams.setSpaceId(spaceId); taskParams.setDescription(description); taskParams.setUserEmail(userEmail); String taskResult = contentStore.performTaskWithNoRetries(SnapshotConstants.CREATE_SNAPSHOT_TASK_NAME, taskParams.serialize()); return CreateSnapshotTaskResult.deserialize(taskResult); } SnapshotTaskClientImpl(ContentStore contentStore); @Override CreateSnapshotTaskResult createSnapshot(String spaceId,
                                                   String description,
                                                   String userEmail); @Override GetSnapshotTaskResult getSnapshot(String snapshotId); @Override CleanupSnapshotTaskResult cleanupSnapshot(String spaceId); @Override CompleteSnapshotTaskResult completeSnapshot(String spaceId); @Override GetSnapshotListTaskResult getSnapshots(); @Override GetSnapshotContentsTaskResult getSnapshotContents(String snapshotId,
                                                             int pageNumber,
                                                             int pageSize,
                                                             String prefix); @Override GetSnapshotHistoryTaskResult getSnapshotHistory(String snapshotId,
                                                           int pageNumber,
                                                           int pageSize); @Override RestoreSnapshotTaskResult restoreSnapshot(String snapshotId,
                                                     String userEmail); @Override RequestRestoreSnapshotTaskResult requestRestoreSnapshot(String snapshotId,
                                                                   String userEmail); CompleteRestoreTaskResult completeRestore(String spaceId,
                                                     int daysToExpire); @Override GetRestoreTaskResult getRestore(String restoreId); @Override GetRestoreTaskResult getRestoreBySnapshot(String snapshotId);  }
@Test public void testCreateSnapshot() throws Exception { String taskName = SnapshotConstants.CREATE_SNAPSHOT_TASK_NAME; CreateSnapshotTaskResult preparedResult = new CreateSnapshotTaskResult(); preparedResult.setSnapshotId(snapshotId); preparedResult.setStatus(snapshotStatus); setupMockWithoutRetries(taskName, preparedResult.serialize()); replayMocks(); CreateSnapshotTaskResult result = taskClient.createSnapshot(spaceId, description, userEmail); assertThat(snapshotId, equalTo(result.getSnapshotId())); }