import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResource;
import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
-import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcCustomization;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.RequestDetails;
import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
BBInputSetupMapperLayer bbInputSetupMapperLayer = new BBInputSetupMapperLayer();
- ObjectMapper mapper = new ObjectMapper();
+ ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
private static final String RESOURCE_PATH = "src/test/resources/__files/ExecuteBuildingBlock/";
+
@Test
public void testMapOrchestrationStatusFromAAI() {
OrchestrationStatus expected = OrchestrationStatus.INVENTORIED;
assertThat(actual, sameBeanAs(expected));
}
+ @Test
+ public void testMapAAIPnfIntoPnf() throws IOException {
+ Pnf expected = mapper.readValue(new File(RESOURCE_PATH + "PnfExpected.json"), Pnf.class);
+ org.onap.aai.domain.yang.Pnf aaiPnf =
+ mapper.readValue(new File(RESOURCE_PATH + "aaiPnfInput.json"), org.onap.aai.domain.yang.Pnf.class);
+
+ Pnf actual = bbInputSetupMapperLayer.mapAAIPnfIntoPnf(aaiPnf);
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
@Test
public void testMapAAICollectionIntoCollection() throws JsonParseException, JsonMappingException, IOException {
org.onap.aai.domain.yang.Collection aaiCollection = mapper
assertThat(actualModelInfoGenericVnf, sameBeanAs(expectedModelInfoGenericVnf));
}
+ @Test
+ public void testMapCatalogPnfToPnf() throws IOException {
+ PnfResourceCustomization pnfResourceCustomization = mapper.readValue(
+ new File(RESOURCE_PATH + "PnfResourceCustomizationInput.json"), PnfResourceCustomization.class);
+
+ PnfResource pnfResource = new PnfResource();
+ pnfResource.setModelUUID("modelUuid");
+ pnfResource.setModelInvariantUUID("modelInvariantUuid");
+ pnfResource.setModelVersion("modelVersion");
+
+ pnfResourceCustomization.setPnfResources(pnfResource);
+
+ ModelInfoPnf expectedModelInfoPnf =
+ mapper.readValue(new File(RESOURCE_PATH + "ModelInfoPnfExpected.json"), ModelInfoPnf.class);
+
+ ModelInfoPnf actualModelInfoPnf = bbInputSetupMapperLayer.mapCatalogPnfToPnf(pnfResourceCustomization);
+
+ assertThat(actualModelInfoPnf, sameBeanAs(expectedModelInfoPnf));
+ }
+
@Test
public void testMapCatalogVfModuleToVfModule() throws JsonParseException, JsonMappingException, IOException {
VfModuleCustomization vfResourceCustomization = mapper