@Test public void testGetWithNoRelations() { Relations relations = testee.getRelations(INTYG_ID); assertNull(relations.getParent()); assertFrontendRelations(relations.getLatestChildRelations(), null, null, null, null); }
@Override public Relations getRelations(String intygsId) { Relations relations = new Relations(); Optional<WebcertCertificateRelation> parentRelation = findParentRelation(intygsId); parentRelation.ifPresent(relations::setParent); List<WebcertCertificateRelation> childRelations = findChildRelations(intygsId); relations.setLatestChildRelations(prepareChildRelationDataForFrontend(childRelations)); return relations; }
CertificateRelationServiceImpl implements CertificateRelationService { @Override public Relations getRelations(String intygsId) { Relations relations = new Relations(); Optional<WebcertCertificateRelation> parentRelation = findParentRelation(intygsId); parentRelation.ifPresent(relations::setParent); List<WebcertCertificateRelation> childRelations = findChildRelations(intygsId); relations.setLatestChildRelations(prepareChildRelationDataForFrontend(childRelations)); return relations; } }
CertificateRelationServiceImpl implements CertificateRelationService { @Override public Relations getRelations(String intygsId) { Relations relations = new Relations(); Optional<WebcertCertificateRelation> parentRelation = findParentRelation(intygsId); parentRelation.ifPresent(relations::setParent); List<WebcertCertificateRelation> childRelations = findChildRelations(intygsId); relations.setLatestChildRelations(prepareChildRelationDataForFrontend(childRelations)); return relations; }  }
CertificateRelationServiceImpl implements CertificateRelationService { @Override public Relations getRelations(String intygsId) { Relations relations = new Relations(); Optional<WebcertCertificateRelation> parentRelation = findParentRelation(intygsId); parentRelation.ifPresent(relations::setParent); List<WebcertCertificateRelation> childRelations = findChildRelations(intygsId); relations.setLatestChildRelations(prepareChildRelationDataForFrontend(childRelations)); return relations; }  @Override Relations getRelations(String intygsId); @Override Optional<WebcertCertificateRelation> findParentRelation(String intygsId); @Override @Transactional(readOnly = true) List<WebcertCertificateRelation> findChildRelations(String intygsId); @Override Optional<WebcertCertificateRelation> getNewestRelationOfType(String intygsId, RelationKod relationKod,
        List<UtkastStatus> allowedStatuses); }
CertificateRelationServiceImpl implements CertificateRelationService { @Override public Relations getRelations(String intygsId) { Relations relations = new Relations(); Optional<WebcertCertificateRelation> parentRelation = findParentRelation(intygsId); parentRelation.ifPresent(relations::setParent); List<WebcertCertificateRelation> childRelations = findChildRelations(intygsId); relations.setLatestChildRelations(prepareChildRelationDataForFrontend(childRelations)); return relations; }  @Override Relations getRelations(String intygsId); @Override Optional<WebcertCertificateRelation> findParentRelation(String intygsId); @Override @Transactional(readOnly = true) List<WebcertCertificateRelation> findChildRelations(String intygsId); @Override Optional<WebcertCertificateRelation> getNewestRelationOfType(String intygsId, RelationKod relationKod,
        List<UtkastStatus> allowedStatuses);  }