@Test public void testDuplicateTexts() { final DiagnosInformation diagnosInformation = createDiagnosInformation("test", "test", "A10", "B20"); doReturn(Optional.of(diagnosInformation)) .when(diagnosInformationRepository) .findFirstByIcd10KodList_kod(anyString()); final Optional<FmbResponse> response = diagnosInformationService.findFmbDiagnosInformationByIcd10Kod("A10"); final long count = response.get().getForms().stream() .filter(fmbForm -> Objects.equals(fmbForm.getName(), FmbFormName.ARBETSFORMAGA)) .map(FmbForm::getContent) .mapToLong(Collection::size) .sum(); final List<FmbContent> contentList = response.get().getForms().stream() .filter(fmbForm -> Objects.equals(fmbForm.getName(), FmbFormName.ARBETSFORMAGA)) .map(FmbForm::getContent) .findAny() .orElse(Lists.emptyList()); assertEquals(DIAGNOSRUBRIK_PREFIX + "A10", response.get().getDiagnosTitle()); assertEquals("A10, B20", response.get().getRelatedDiagnoses()); assertEquals(1, count); assertEquals("test", contentList.get(0).getText()); assertNull(contentList.get(0).getList()); }
@Override @Transactional(readOnly = true) public Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod) { Preconditions.checkArgument(Objects.nonNull(icd10Kod)); return getFmbContent(icd10Kod); }
FmbDiagnosInformationServiceImpl extends FmbBaseService implements FmbDiagnosInformationService { @Override @Transactional(readOnly = true) public Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod) { Preconditions.checkArgument(Objects.nonNull(icd10Kod)); return getFmbContent(icd10Kod); } }
FmbDiagnosInformationServiceImpl extends FmbBaseService implements FmbDiagnosInformationService { @Override @Transactional(readOnly = true) public Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod) { Preconditions.checkArgument(Objects.nonNull(icd10Kod)); return getFmbContent(icd10Kod); } FmbDiagnosInformationServiceImpl(
        final DiagnosService diagnosService,
        final FmbSjukfallService sjukfallService,
        final DiagnosInformationRepository repository); }
FmbDiagnosInformationServiceImpl extends FmbBaseService implements FmbDiagnosInformationService { @Override @Transactional(readOnly = true) public Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod) { Preconditions.checkArgument(Objects.nonNull(icd10Kod)); return getFmbContent(icd10Kod); } FmbDiagnosInformationServiceImpl(
        final DiagnosService diagnosService,
        final FmbSjukfallService sjukfallService,
        final DiagnosInformationRepository repository); @Override @Transactional(readOnly = true) Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod); @Override MaximalSjukskrivningstidResponse validateSjukskrivningtidForPatient(
        final MaximalSjukskrivningstidRequest maximalSjukskrivningstidRequest); }
FmbDiagnosInformationServiceImpl extends FmbBaseService implements FmbDiagnosInformationService { @Override @Transactional(readOnly = true) public Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod) { Preconditions.checkArgument(Objects.nonNull(icd10Kod)); return getFmbContent(icd10Kod); } FmbDiagnosInformationServiceImpl(
        final DiagnosService diagnosService,
        final FmbSjukfallService sjukfallService,
        final DiagnosInformationRepository repository); @Override @Transactional(readOnly = true) Optional<FmbResponse> findFmbDiagnosInformationByIcd10Kod(final String icd10Kod); @Override MaximalSjukskrivningstidResponse validateSjukskrivningtidForPatient(
        final MaximalSjukskrivningstidRequest maximalSjukskrivningstidRequest);  }