aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-enrichment-lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java6
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java16
2 files changed, 12 insertions, 10 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java
index a5d1ac1ba2..44c1ef8c72 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java
@@ -35,6 +35,8 @@ import org.openecomp.sdc.datatypes.error.ErrorMessage;
import org.openecomp.sdc.enrichment.EnrichmentInfo;
import org.openecomp.sdc.enrichment.inter.ExternalArtifactEnricherInterface;
import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
@@ -143,7 +145,9 @@ public class MonitoringMibEnricher implements ExternalArtifactEnricherInterface
if (!artifact.isPresent()) {
return;
}
- path = componentName + File.separator + ArtifactCategory.DEPLOYMENT.getDisplayName()
+ String unifiedComponentNodeType =
+ ToscaNodeType.ABSTRACT_NODE_TYPE_PREFIX + DataModelUtil.getNamespaceSuffix(componentName);
+ path = unifiedComponentNodeType + File.separator + ArtifactCategory.DEPLOYMENT.getDisplayName()
+ File.separator + type.name();
MonitoringArtifactInfo monitoringArtifactInfo = new MonitoringArtifactInfo();
monitoringArtifactInfo.setName(path);
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
index 5f1a67138d..3730a15465 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
@@ -31,6 +31,8 @@ import org.openecomp.core.model.dao.EnrichedServiceModelDao;
import org.openecomp.core.model.types.ServiceArtifact;
import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.sdc.enrichment.EnrichmentInfo;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
@@ -52,11 +54,6 @@ import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.times;
-/**
- * @author shiria
- * @since November 06, 2016.
- */
-
public class MonitoringMibEnricherTest {
@Mock
private ComponentArtifactDao componentArtifactDaoMock;
@@ -89,15 +86,16 @@ public class MonitoringMibEnricherTest {
monitoringMibEnricher.enrichComponent(componentEntity, vspId, version);
String componentName = componentEntity.getComponentCompositionData().getName();
-
+ String unifiedComponentName =
+ ToscaNodeType.ABSTRACT_NODE_TYPE_PREFIX + DataModelUtil.getNamespaceSuffix(componentName);
ArgumentCaptor<ServiceArtifact> expectedServiceArtifact =
ArgumentCaptor.forClass(ServiceArtifact.class);
Mockito.verify(enrichedServiceModelDaoMock, atLeastOnce())
.storeExternalArtifact(expectedServiceArtifact.capture());
- Assert
- .assertEquals(expectedServiceArtifact.getValue().getName().startsWith(componentName), true);
+ Assert.assertEquals(expectedServiceArtifact.getValue().getName()
+ .startsWith(unifiedComponentName), true);
Assert.assertEquals(expectedServiceArtifact.getValue().getName(),
- componentName + File.separator + ArtifactCategory.DEPLOYMENT.getDisplayName() +
+ unifiedComponentName + File.separator + ArtifactCategory.DEPLOYMENT.getDisplayName() +
File.separator + MonitoringUploadType.VES_EVENTS + File.separator + "mib1.yml");
}