@Test public void testCloseAnsweredQuestionToFKAsHandledOK() { FragaSvar fragaSvar = buildFragaSvar(1L, LocalDateTime.now(), LocalDateTime.now()); fragaSvar.setFrageStallare(FrageStallare.WEBCERT.getKod()); fragaSvar.setFrageText("Fråga från WC till FK"); fragaSvar.setStatus(Status.ANSWERED); fragaSvar.setSvarsText("Med ett svar från FK"); ArgumentCaptor<FragaSvar> fsCapture = ArgumentCaptor.forClass(FragaSvar.class); when(fragasvarRepositoryMock.findById(1L)).thenReturn(Optional.of(fragaSvar)); when(fragasvarRepositoryMock.save(fsCapture.capture())).thenReturn(fragaSvar); when(webCertUserService.getUser()).thenReturn(createUser()); service.closeQuestionAsHandled(1L); verify(notificationServiceMock).sendNotificationForQAs(INTYG_ID, NotificationEvent.QUESTION_FROM_CARE_WITH_ANSWER_HANDLED); verify(certificateEventService) .createCertificateEvent(anyString(), anyString(), eq(EventCode.HANFRFV), anyString()); verify(fragasvarRepositoryMock).findById(1L); verify(fragasvarRepositoryMock).save(any(FragaSvar.class)); assertEquals(Status.CLOSED, fsCapture.getValue().getStatus()); verifyNoInteractions(arendeDraftService); }
@Override public FragaSvar closeQuestionAsHandled(Long frageSvarId) { return closeQuestionAsHandled(lookupFragaSvar(frageSvarId)); }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar closeQuestionAsHandled(Long frageSvarId) { return closeQuestionAsHandled(lookupFragaSvar(frageSvarId)); } }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar closeQuestionAsHandled(Long frageSvarId) { return closeQuestionAsHandled(lookupFragaSvar(frageSvarId)); }  }
FragaSvarServiceImpl implements FragaSvarService { @Override public FragaSvar closeQuestionAsHandled(Long frageSvarId) { return closeQuestionAsHandled(lookupFragaSvar(frageSvarId)); }  @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 closeQuestionAsHandled(Long frageSvarId) { return closeQuestionAsHandled(lookupFragaSvar(frageSvarId)); }  @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);  }