@Test
public void shouldThrowStorageExceptionIfDatabaseCallFailsInCallToGetAllSnapshots() throws Exception {

    throwWhenDAOMethodCalled(new SnapshotStoreMethodCallable() {
        @Override
        public void setup(OnDiskSnapshotsStore onDiskSnapshotsStore, SnapshotsDAO mockDAO, Throwable toThrow) throws Exception {
            when(mockDAO.getAllSnapshotsFromLatestToOldest()).thenThrow(toThrow);
        }
        @Override
        public void runThrowingMethod(OnDiskSnapshotsStore onDiskSnapshotsStore) throws Exception {
            onDiskSnapshotsStore.getAllSnapshotsFromLatestToOldest();
        }
    });
}