@Test public void inspectModel_throwing_doesnot_stop_execution() throws Exception { given(agent.inspectModel(anyString(), any(Integer.class))).willThrow(RuntimeException.class); inspector.inspect(); then(agent).should(times(2)).inspectModel(anyString(), any(Integer.class)); }
@Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") public void inspect() { Map<String, M> store = new HashMap<>(this.store); store.forEach((key, model) -> { try { List<PatchOperation> operations = agent.inspectModel(key, model); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } catch (Exception e) { log.warn("Problem inspecting model \"{}\"", key, e); } }); }
ModelInspector { @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") public void inspect() { Map<String, M> store = new HashMap<>(this.store); store.forEach((key, model) -> { try { List<PatchOperation> operations = agent.inspectModel(key, model); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } catch (Exception e) { log.warn("Problem inspecting model \"{}\"", key, e); } }); } }
ModelInspector { @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") public void inspect() { Map<String, M> store = new HashMap<>(this.store); store.forEach((key, model) -> { try { List<PatchOperation> operations = agent.inspectModel(key, model); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } catch (Exception e) { log.warn("Problem inspecting model \"{}\"", key, e); } }); }  }
ModelInspector { @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") public void inspect() { Map<String, M> store = new HashMap<>(this.store); store.forEach((key, model) -> { try { List<PatchOperation> operations = agent.inspectModel(key, model); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } catch (Exception e) { log.warn("Problem inspecting model \"{}\"", key, e); } }); }  @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") void inspect(); }
ModelInspector { @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") public void inspect() { Map<String, M> store = new HashMap<>(this.store); store.forEach((key, model) -> { try { List<PatchOperation> operations = agent.inspectModel(key, model); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } catch (Exception e) { log.warn("Problem inspecting model \"{}\"", key, e); } }); }  @Scheduled(initialDelayString = "${model.inspection.interval:60000}", fixedRateString = "${model.inspection.interval:60000}") void inspect();  }