use of io.crate.operation.reference.sys.repositories.SysRepositoriesService in project crate by crate.
the class SysSnapshotsTest method testErrorsOnRetrievingSnapshotsAreIgnored.
@Test
public void testErrorsOnRetrievingSnapshotsAreIgnored() throws Exception {
SysRepositoriesService sysRepos = mock(SysRepositoriesService.class);
Iterable<?> objects = Collections.singletonList((Object) new SysRepository("foo", "url", ImmutableMap.of()));
when(sysRepos.repositoriesGetter()).then(invocation -> objects);
SnapshotsService snapshotService = mock(SnapshotsService.class);
when(snapshotService.snapshots(anyString(), anyBoolean())).thenThrow(new IllegalStateException("dummy"));
SysSnapshots sysSnapshots = new SysSnapshots(sysRepos, snapshotService);
assertThat(sysSnapshots.snapshotsGetter().iterator().hasNext(), is(false));
}
Aggregations