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));
}
Aggregations