@Test public void testUpdateDiagnosInfoWillNotBeDoneIfFmdxInfoCouldNotBeFetched() throws Exception { final String beskrivning = "test"; Mockito.when(fmbConsumer.getForsakringsmedicinskDiagnosinformation()).thenReturn(null); Mockito.when(fmbConsumer.getTypfall()).thenReturn(createTypfall("", "J22")); fmbServiceImpl.updateData(); Mockito.verify(diagnosInformationRepository, times(0)).deleteAllInBatch(); Mockito.verify(diagnosInformationRepository, times(0)).saveAll(fmbCaptor.capture()); }
@Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) public void updateData() { try { LOG.info("FMB data update started"); performUpdate(); LOG.info("FMB data update done"); } catch (Exception e) { LOG.error("Failed to update FMB", e); } }
FmbServiceImpl implements FmbService { @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) public void updateData() { try { LOG.info("FMB data update started"); performUpdate(); LOG.info("FMB data update done"); } catch (Exception e) { LOG.error("Failed to update FMB", e); } } }
FmbServiceImpl implements FmbService { @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) public void updateData() { try { LOG.info("FMB data update started"); performUpdate(); LOG.info("FMB data update done"); } catch (Exception e) { LOG.error("Failed to update FMB", e); } } FmbServiceImpl(final FmbConsumer fmbConsumer, final DiagnosInformationRepository repository); }
FmbServiceImpl implements FmbService { @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) public void updateData() { try { LOG.info("FMB data update started"); performUpdate(); LOG.info("FMB data update done"); } catch (Exception e) { LOG.error("Failed to update FMB", e); } } FmbServiceImpl(final FmbConsumer fmbConsumer, final DiagnosInformationRepository repository); @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) void updateData(); }
FmbServiceImpl implements FmbService { @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) public void updateData() { try { LOG.info("FMB data update started"); performUpdate(); LOG.info("FMB data update done"); } catch (Exception e) { LOG.error("Failed to update FMB", e); } } FmbServiceImpl(final FmbConsumer fmbConsumer, final DiagnosInformationRepository repository); @Override @Scheduled(cron = "${fmb.dataupdate.cron}") @SchedulerLock(name = JOB_NAME) void updateData();  }