}.run();
}
@Test
public void testPruneHistory() throws Exception {
final PruneJobUpdateHistory pruneHistory = new PruneJobUpdateHistory()
.setHistoryPruneThresholdMs(1L)
.setPerJobRetainCount(1);
new MutationFixture() {
@Override
protected void setupExpectations() throws Exception {
storageUtil.expectWriteOperation();
expect(storageUtil.jobUpdateStore.pruneHistory(
pruneHistory.getPerJobRetainCount(),
pruneHistory.getHistoryPruneThresholdMs())).andReturn(ImmutableSet.of("id1"));
streamMatcher.expectTransaction(Op.pruneJobUpdateHistory(pruneHistory)).andReturn(position);
}
@Override
protected void performMutations(MutableStoreProvider storeProvider) {
storeProvider.getJobUpdateStore().pruneHistory(
pruneHistory.getPerJobRetainCount(),
pruneHistory.getHistoryPruneThresholdMs());
}
}.run();
}