NodeStoreChecksService implements NodeStoreChecks { @Override public void check(NodeStore globalStore, MountedNodeStore mountedStore) { ErrorHolder errorHolder = new ErrorHolder(); checkers.forEach( c -> { log.info("Checking NodeStore from mount {} with {}", mountedStore.getMount().getName(), c ); check(mountedStore, errorHolder, globalStore, c); log.info("Check complete"); }); errorHolder.end(); } NodeStoreChecksService();  NodeStoreChecksService(MountInfoProvider mip, List<MountedNodeStoreChecker<?>> checkers); @Override void check(NodeStore globalStore, MountedNodeStore mountedStore);  }
@Test public void noCheckers() throws CommitFailedException { NodeStoreChecksService checks = new NodeStoreChecksService(); checks.check(globalStore, new MountedNodeStore(mount, mountedStore)); }
@Test(expected = IllegalRepositoryStateException.class) public void failOnNodeCoveredByMount() { NodeStoreChecksService checks = new NodeStoreChecksService(defaultMountInfoProvider(), Arrays.asList(new FailOnTreeNameChecker("third"))); checks.check(globalStore, new MountedNodeStore(mount, mountedStore)); }
@Test public void doNotFailOnNodeNotCoveredByMount() { NodeStoreChecksService checks = new NodeStoreChecksService(defaultMountInfoProvider(), Arrays.asList(new FailOnTreeNameChecker("not-covered"))); checks.check(globalStore, new MountedNodeStore(mount, mountedStore)); }