@Test public void testThatDotsInIcd10CodesAreRemoved() throws Exception { doReturn(createFmdxInformation("", "J22.2", "J22.4")).when(fmbConsumer).getForsakringsmedicinskDiagnosinformation(); Mockito.when(fmbConsumer.getTypfall()).thenReturn(createTypfall("", "J22.2", "J22.4")); fmbServiceImpl.updateData(); Mockito.verify(diagnosInformationRepository, times(1)).saveAll(fmbCaptor.capture()); List<List<DiagnosInformation>> fmbCaptorAllValues = fmbCaptor.getAllValues(); assertEquals("J222", fmbCaptorAllValues.get(0).get(0).getIcd10KodList().get(0).getKod()); assertEquals("J224", fmbCaptorAllValues.get(0).get(0).getIcd10KodList().get(1).getKod()); }
@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();  }