SnapshotTaskClientImpl implements SnapshotTaskClient { @Override public GetSnapshotHistoryTaskResult getSnapshotHistory(String snapshotId, int pageNumber, int pageSize) throws ContentStoreException { GetSnapshotHistoryTaskParameters taskParams = new GetSnapshotHistoryTaskParameters(); taskParams.setSnapshotId(snapshotId); taskParams.setPageNumber(pageNumber); taskParams.setPageSize(pageSize); String taskResult = contentStore.performTask(SnapshotConstants.GET_SNAPSHOT_HISTORY_TASK_NAME, taskParams.serialize()); return GetSnapshotHistoryTaskResult.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 testGetSnapshotHistory() throws Exception { String taskName = SnapshotConstants.GET_SNAPSHOT_HISTORY_TASK_NAME; SnapshotHistoryItem historyItem = new SnapshotHistoryItem(); historyItem.setHistory(historyValue); historyItem.setHistoryDate(snapshotDate); List<SnapshotHistoryItem> historyItems = new ArrayList<>(); historyItems.add(historyItem); GetSnapshotHistoryTaskResult preparedResult = new GetSnapshotHistoryTaskResult(); preparedResult.setHistoryItems(historyItems); setupMock(taskName, preparedResult.serialize()); replayMocks(); GetSnapshotHistoryTaskResult result = taskClient.getSnapshotHistory(snapshotId, 1, 1000); SnapshotHistoryItem item = result.getHistoryItems().get(0); assertThat(historyValue, equalTo(item.getHistory())); assertThat(snapshotDate, equalTo(item.getHistoryDate())); }