SnapshotTaskClientImpl implements SnapshotTaskClient { @Override public GetSnapshotTaskResult getSnapshot(String snapshotId) throws ContentStoreException { GetSnapshotTaskParameters taskParams = new GetSnapshotTaskParameters(); taskParams.setSnapshotId(snapshotId); String taskResult = contentStore.performTask(SnapshotConstants.GET_SNAPSHOT_TASK_NAME, taskParams.serialize()); return GetSnapshotTaskResult.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 testGetSnapshot() throws Exception { String taskName = SnapshotConstants.GET_SNAPSHOT_TASK_NAME; GetSnapshotTaskResult preparedResult = new GetSnapshotTaskResult(); preparedResult.setSnapshotId(snapshotId); preparedResult.setDescription(description); preparedResult.setSnapshotDate(snapshotDate); preparedResult.setSourceHost(host); preparedResult.setSourceSpaceId(spaceId); preparedResult.setSourceStoreId(storeId); preparedResult.setStatus(snapshotStatus); preparedResult.setMemberId(memberId); setupMock(taskName, preparedResult.serialize()); replayMocks(); GetSnapshotTaskResult result = taskClient.getSnapshot(snapshotId); assertThat(snapshotId, equalTo(result.getSnapshotId())); assertThat(description, equalTo(result.getDescription())); assertThat(snapshotDate, equalTo(result.getSnapshotDate())); assertThat(host, equalTo(result.getSourceHost())); assertThat(spaceId, equalTo(result.getSourceSpaceId())); assertThat(storeId, equalTo(result.getSourceStoreId())); assertThat(snapshotStatus, equalTo(result.getStatus())); assertThat(memberId, equalTo(result.getMemberId())); }