@Test public void testDecorateWithEmptyList() { List<ListIntygEntry> listIntygEntries = new ArrayList<>(); testee.decorateIntygListWithRelations(listIntygEntries); verifyNoInteractions(listRelationsForCertificateResponderInterface); }
@Override public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) { ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream() .map(ListIntygEntry::getIntygId) .collect(Collectors.toList())); if (response != null) { for (IntygRelations ir : response.getIntygRelation()) { for (ListIntygEntry lie : fullIntygItemList) { if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) { lie.setRelations(new Relations()); for (Relation r : ir.getRelation()) { applyRelation(lie.getIntygId(), lie.getRelations(), r); } } } } } for (ListIntygEntry lie : fullIntygItemList) { Relations relations = certificateRelationService.getRelations(lie.getIntygId()); mergeRelations(lie.getRelations(), relations); } }
IntygRelationHelperImpl implements IntygRelationHelper { @Override public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) { ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream() .map(ListIntygEntry::getIntygId) .collect(Collectors.toList())); if (response != null) { for (IntygRelations ir : response.getIntygRelation()) { for (ListIntygEntry lie : fullIntygItemList) { if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) { lie.setRelations(new Relations()); for (Relation r : ir.getRelation()) { applyRelation(lie.getIntygId(), lie.getRelations(), r); } } } } } for (ListIntygEntry lie : fullIntygItemList) { Relations relations = certificateRelationService.getRelations(lie.getIntygId()); mergeRelations(lie.getRelations(), relations); } } }
IntygRelationHelperImpl implements IntygRelationHelper { @Override public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) { ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream() .map(ListIntygEntry::getIntygId) .collect(Collectors.toList())); if (response != null) { for (IntygRelations ir : response.getIntygRelation()) { for (ListIntygEntry lie : fullIntygItemList) { if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) { lie.setRelations(new Relations()); for (Relation r : ir.getRelation()) { applyRelation(lie.getIntygId(), lie.getRelations(), r); } } } } } for (ListIntygEntry lie : fullIntygItemList) { Relations relations = certificateRelationService.getRelations(lie.getIntygId()); mergeRelations(lie.getRelations(), relations); } }  }
IntygRelationHelperImpl implements IntygRelationHelper { @Override public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) { ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream() .map(ListIntygEntry::getIntygId) .collect(Collectors.toList())); if (response != null) { for (IntygRelations ir : response.getIntygRelation()) { for (ListIntygEntry lie : fullIntygItemList) { if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) { lie.setRelations(new Relations()); for (Relation r : ir.getRelation()) { applyRelation(lie.getIntygId(), lie.getRelations(), r); } } } } } for (ListIntygEntry lie : fullIntygItemList) { Relations relations = certificateRelationService.getRelations(lie.getIntygId()); mergeRelations(lie.getRelations(), relations); } }  @Override Relations getRelationsForIntyg(String intygId); @Override void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList); }
IntygRelationHelperImpl implements IntygRelationHelper { @Override public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) { ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream() .map(ListIntygEntry::getIntygId) .collect(Collectors.toList())); if (response != null) { for (IntygRelations ir : response.getIntygRelation()) { for (ListIntygEntry lie : fullIntygItemList) { if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) { lie.setRelations(new Relations()); for (Relation r : ir.getRelation()) { applyRelation(lie.getIntygId(), lie.getRelations(), r); } } } } } for (ListIntygEntry lie : fullIntygItemList) { Relations relations = certificateRelationService.getRelations(lie.getIntygId()); mergeRelations(lie.getRelations(), relations); } }  @Override Relations getRelationsForIntyg(String intygId); @Override void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList);  }