SnapshotTaskClientImpl implements SnapshotTaskClient { @Override public GetSnapshotListTaskResult getSnapshots() throws ContentStoreException { String taskResult = contentStore.performTask(SnapshotConstants.GET_SNAPSHOTS_TASK_NAME, ""); return GetSnapshotListTaskResult.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 testGetSnapshots() throws Exception { String taskName = SnapshotConstants.GET_SNAPSHOTS_TASK_NAME; List<SnapshotSummary> summaries = new ArrayList<>(); summaries.add( new SnapshotSummary(snapshotId, snapshotStatus, description, storeId, spaceId)); GetSnapshotListTaskResult preparedResult = new GetSnapshotListTaskResult(); preparedResult.setSnapshots(summaries); setupMock(taskName, preparedResult.serialize()); replayMocks(); GetSnapshotListTaskResult result = taskClient.getSnapshots(); List<SnapshotSummary> resultSummaryList = result.getSnapshots(); SnapshotSummary resultSummary = resultSummaryList.get(0); assertThat(snapshotId, equalTo(resultSummary.getSnapshotId())); assertThat(description, equalTo(resultSummary.getDescription())); assertThat(snapshotStatus, equalTo(resultSummary.getStatus())); assertThat(storeId, equalTo(resultSummary.getSourceStoreId())); assertThat(spaceId, equalTo(resultSummary.getSourceSpaceId())); }