use of org.onap.aai.domain.yang.RelatedToProperty in project so by onap.
the class AaiConnectionTest method testRelatedToProperty.
@Test
public void testRelatedToProperty() {
// given
final Relationship relationship = new Relationship();
final RelatedToProperty property = new RelatedToProperty();
property.setPropertyKey(KEY);
property.setPropertyValue(VALUE);
relationship.getRelatedToProperty().add(property);
// when
final String value = AaiConnection.getRelatedToProperty(relationship, KEY);
// then
assertEquals(VALUE, value);
}
use of org.onap.aai.domain.yang.RelatedToProperty 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