use of org.onap.aai.domain.yang.RelationshipData in project so by onap.
the class AaiConnectionTest method testRelationshipData.
@Test
public void testRelationshipData() {
// given
final Relationship relationship = new Relationship();
final RelationshipData data = new RelationshipData();
data.setRelationshipKey(KEY);
data.setRelationshipValue(VALUE);
relationship.getRelationshipData().add(data);
// when
final String value = AaiConnection.getRelationshipData(relationship, KEY);
// then
assertEquals(VALUE, value);
}
use of org.onap.aai.domain.yang.RelationshipData in project so by onap.
the class AAIPnfResources method prepareRelationErrorMessage.
private String prepareRelationErrorMessage(org.onap.aai.domain.yang.Pnf pnfFromAai, Relationship relationship) {
String serviceInstanceName = "";
String serviceInstanceId = "";
for (RelationshipData relationshipData : relationship.getRelationshipData()) {
if (relationshipData.getRelationshipKey().equals("service-instance.service-instance-id")) {
serviceInstanceId = relationshipData.getRelationshipValue();
break;
}
}
for (RelatedToProperty relatedToProperty : relationship.getRelatedToProperty()) {
if (relatedToProperty.getPropertyKey().equals("service-instance.service-instance-name")) {
serviceInstanceName = relatedToProperty.getPropertyValue();
break;
}
}
return String.format("Pnf with name %s exist with orchestration status %s and is related to %s service with certain service-instance-id: %s", pnfFromAai.getPnfName(), pnfFromAai.getOrchestrationStatus(), serviceInstanceName, serviceInstanceId);
}
Aggregations