Search in sources :

Example 16 with Platform

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Platform in project so by onap.

the class BBInputSetupTest method testCreateNetwork.

@Test
public void testCreateNetwork() {
    String networkId = "networkId";
    String instanceName = "networkName";
    Map<String, String> cloudParams = new HashMap<>();
    cloudParams.put("param1", "param1Value");
    L3Network expected = new L3Network();
    expected.setNetworkId(networkId);
    expected.setNetworkName(instanceName);
    expected.setCloudParams(cloudParams);
    Platform platform = new Platform();
    platform.setPlatformName("platformName");
    expected.setPlatform(platform);
    LineOfBusiness lineOfBusiness = new LineOfBusiness();
    lineOfBusiness.setLineOfBusinessName("lineOfBusiness");
    expected.setLineOfBusiness(lineOfBusiness);
    expected.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
    Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
    List<Map<String, String>> instanceParams = new ArrayList<>();
    instanceParams.add(cloudParams);
    org.onap.so.serviceinstancebeans.Platform platformRequest = new org.onap.so.serviceinstancebeans.Platform();
    org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusinessRequest = new org.onap.so.serviceinstancebeans.LineOfBusiness();
    lineOfBusinessRequest.setLineOfBusinessName("lineOfBusiness");
    platformRequest.setPlatformName("platformName");
    BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(REQUEST_ID).setPlatform(platformRequest).setLineOfBusiness(lineOfBusinessRequest).build();
    L3Network actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, instanceParams, parameter);
    assertThat(actual, sameBeanAs(expected));
    assertEquals("LookupKeyMap is populated", networkId, lookupKeyMap.get(ResourceKey.NETWORK_ID));
    expected.getCloudParams().clear();
    actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, null, parameter);
    assertThat(actual, sameBeanAs(expected));
}
Also used : L3Network(org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network) Platform(org.onap.so.bpmn.servicedecomposition.bbobjects.Platform) HashMap(java.util.HashMap) AAIFluentTypeBuilder(org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder) ArrayList(java.util.ArrayList) ResourceKey(org.onap.so.bpmn.servicedecomposition.entities.ResourceKey) LineOfBusiness(org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness) Map(java.util.Map) BaseBBInputSetupTestHelper.prepareLookupKeyMap(org.onap.so.bpmn.servicedecomposition.tasks.BaseBBInputSetupTestHelper.prepareLookupKeyMap) HashMap(java.util.HashMap) Test(org.junit.Test)

Aggregations

Platform (org.onap.so.bpmn.servicedecomposition.bbobjects.Platform)16 Test (org.junit.Test)10 LineOfBusiness (org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness)8 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)7 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)7 File (java.io.File)6 HashMap (java.util.HashMap)6 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)6 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)4 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)4 ArrayList (java.util.ArrayList)3 InstanceGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)3 ModelInfoInstanceGroup (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup)3 Service (org.onap.so.db.catalog.beans.Service)3 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)3 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)3 Map (java.util.Map)2 AAIResultWrapper (org.onap.aaiclient.client.aai.entities.AAIResultWrapper)2 AAIFluentTypeBuilder (org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder)2 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)2