use of org.onap.so.asdc.installer.ASDCElementInfo in project so by onap.
the class ASDCElementInfoTest method createASDCElementInfoFromArtifact.
@Test
public void createASDCElementInfoFromArtifact() {
for (String eVal : ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST) {
String generatedArtifactName = eVal + " 1";
UUID generatedUUIDForArtifact = UUID.randomUUID();
IArtifactInfo artifactInfo = Mockito.mock(IArtifactInfo.class);
Mockito.when(artifactInfo.getArtifactType()).thenReturn(eVal);
Mockito.when(artifactInfo.getArtifactName()).thenReturn(generatedArtifactName);
Mockito.when(artifactInfo.getArtifactUUID()).thenReturn(generatedUUIDForArtifact.toString());
ASDCElementInfo elementInfoFromArtifact = ASDCElementInfo.createElementFromVfArtifactInfo(artifactInfo);
assertTrue(elementInfoFromArtifact.toString().contains(generatedArtifactName));
assertTrue(elementInfoFromArtifact.toString().contains(generatedUUIDForArtifact.toString()));
assertFalse(ASDCElementInfo.ASDCElementTypeEnum.VNF_RESOURCE.name().equals(elementInfoFromArtifact.getType()));
assertEquals(eVal, elementInfoFromArtifact.getType());
assertFalse(elementInfoFromArtifact.toString().contains("MyInfo3: someValue"));
elementInfoFromArtifact.addElementInfo("MyInfo3", "someValue");
assertTrue(elementInfoFromArtifact.toString().contains("MyInfo3: someValue"));
}
}
Aggregations