@Test(expected = WebCertServiceException.class) public void intygWithoutFragaSvarDoesNotAcceptFraga() { FragaSvar fragaSvar = buildFragaSvar(1L, LocalDateTime.now(), LocalDateTime.now()); fragaSvar.getIntygsReferens().setIntygsTyp("ts-bas"); when(authoritiesHelper.isFeatureActive(AuthoritiesConstants.FEATURE_HANTERA_FRAGOR, "ts-bas")).thenReturn(false); service.processIncomingQuestion(fragaSvar); fail("Processing should have thrown an exception"); }
@Override public FragaSvar processIncomingQuestion(FragaSvar fragaSvar) { validateAcceptsQuestions(fragaSvar); monitoringService.logQuestionReceived(fragaSvar.getFrageStallare(), ((fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId()), fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), getEnhetsId(fragaSvar), fragaSvar.getAmne(), fragaSvar.getKompletteringar().stream().map(Komplettering::getFalt).collect(Collectors.toList())); return fragaSvarRepository.save(fragaSvar); }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar processIncomingQuestion(FragaSvar fragaSvar) { validateAcceptsQuestions(fragaSvar); monitoringService.logQuestionReceived(fragaSvar.getFrageStallare(), ((fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId()), fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), getEnhetsId(fragaSvar), fragaSvar.getAmne(), fragaSvar.getKompletteringar().stream().map(Komplettering::getFalt).collect(Collectors.toList())); return fragaSvarRepository.save(fragaSvar); } }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar processIncomingQuestion(FragaSvar fragaSvar) { validateAcceptsQuestions(fragaSvar); monitoringService.logQuestionReceived(fragaSvar.getFrageStallare(), ((fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId()), fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), getEnhetsId(fragaSvar), fragaSvar.getAmne(), fragaSvar.getKompletteringar().stream().map(Komplettering::getFalt).collect(Collectors.toList())); return fragaSvarRepository.save(fragaSvar); }  }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar processIncomingQuestion(FragaSvar fragaSvar) { validateAcceptsQuestions(fragaSvar); monitoringService.logQuestionReceived(fragaSvar.getFrageStallare(), ((fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId()), fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), getEnhetsId(fragaSvar), fragaSvar.getAmne(), fragaSvar.getKompletteringar().stream().map(Komplettering::getFalt).collect(Collectors.toList())); return fragaSvarRepository.save(fragaSvar); }  @Override FragaSvar processIncomingQuestion(FragaSvar fragaSvar); @Override FragaSvar processIncomingAnswer(Long internId, String svarsText, LocalDateTime svarSigneringsDatum); @Override @Transactional(readOnly = true) List<FragaSvarView> getFragaSvar(String intygId); @Override FragaSvar saveSvar(Long fragaSvarsId, String svarsText); @Override List<FragaSvarView> answerKomplettering(final String intygsId, final String svarsText); @Override FragaSvar saveNewQuestion(String intygId, String typ, Amne amne, String frageText); @Override List<FragaSvar> setVidareBefordrad(final String intygsId); @Override FragaSvar closeQuestionAsHandled(Long frageSvarId); @Override void closeCompletionsAsHandled(String intygId); @Override void closeAllNonClosedQuestions(String intygsId); @Override FragaSvar openQuestionAsUnhandled(Long frageSvarId); @Override @Transactional(readOnly = true) QueryFragaSvarResponse filterFragaSvar(Filter filter); @Override @Transactional(readOnly = true) List<Lakare> getFragaSvarHsaIdByEnhet(String enhetsId); @Override Map<String, Long> getNbrOfUnhandledFragaSvarForCareUnits(List<String> vardenheterIds, Set<String> intygsTyper); }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar processIncomingQuestion(FragaSvar fragaSvar) { validateAcceptsQuestions(fragaSvar); monitoringService.logQuestionReceived(fragaSvar.getFrageStallare(), ((fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId()), fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), getEnhetsId(fragaSvar), fragaSvar.getAmne(), fragaSvar.getKompletteringar().stream().map(Komplettering::getFalt).collect(Collectors.toList())); return fragaSvarRepository.save(fragaSvar); }  @Override FragaSvar processIncomingQuestion(FragaSvar fragaSvar); @Override FragaSvar processIncomingAnswer(Long internId, String svarsText, LocalDateTime svarSigneringsDatum); @Override @Transactional(readOnly = true) List<FragaSvarView> getFragaSvar(String intygId); @Override FragaSvar saveSvar(Long fragaSvarsId, String svarsText); @Override List<FragaSvarView> answerKomplettering(final String intygsId, final String svarsText); @Override FragaSvar saveNewQuestion(String intygId, String typ, Amne amne, String frageText); @Override List<FragaSvar> setVidareBefordrad(final String intygsId); @Override FragaSvar closeQuestionAsHandled(Long frageSvarId); @Override void closeCompletionsAsHandled(String intygId); @Override void closeAllNonClosedQuestions(String intygsId); @Override FragaSvar openQuestionAsUnhandled(Long frageSvarId); @Override @Transactional(readOnly = true) QueryFragaSvarResponse filterFragaSvar(Filter filter); @Override @Transactional(readOnly = true) List<Lakare> getFragaSvarHsaIdByEnhet(String enhetsId); @Override Map<String, Long> getNbrOfUnhandledFragaSvarForCareUnits(List<String> vardenheterIds, Set<String> intygsTyper);  }