Search in sources :

Example 1 with ModuleResource

use of org.onap.so.bpmn.core.domain.ModuleResource in project so by onap.

the class InstnaceResourceListTest method testVFResourceWithModule.

@Test
public void testVFResourceWithModule() throws IOException {
    String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json")));
    VnfResource vnfResource = new VnfResource();
    vnfResource.setResourceInput("{\"a\":\"ipaddress|127.0.0.1\"}");
    // Come from package org.onap.so.bpmn.core.domain.VnfResourceTest
    List<ModuleResource> moduleResources;
    moduleResources = new ArrayList<>();
    ModuleResource moduleresource = getModuleResource();
    moduleResources.add(moduleresource);
    vnfResource.setModules(moduleResources);
    List<Resource> instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest);
    Assert.assertEquals(2, instanceResourceList.size());
    Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType());
    Assert.assertEquals(ResourceType.MODULE, instanceResourceList.get(1).getResourceType());
}
Also used : VnfResource(org.onap.so.bpmn.core.domain.VnfResource) GroupResource(org.onap.so.bpmn.core.domain.GroupResource) VnfcResource(org.onap.so.bpmn.core.domain.VnfcResource) VnfResource(org.onap.so.bpmn.core.domain.VnfResource) Resource(org.onap.so.bpmn.core.domain.Resource) ModuleResource(org.onap.so.bpmn.core.domain.ModuleResource) ModuleResource(org.onap.so.bpmn.core.domain.ModuleResource) Test(org.junit.Test)

Example 2 with ModuleResource

use of org.onap.so.bpmn.core.domain.ModuleResource in project so by onap.

the class InstnaceResourceListTest method getModuleResource.

private ModuleResource getModuleResource() {
    ModuleResource moduleresource = new ModuleResource();
    moduleresource.setVfModuleName("vfModuleName");
    moduleresource.setHeatStackId("heatStackId");
    moduleresource.setIsBase(true);
    moduleresource.setVfModuleLabel("vfModuleLabel");
    moduleresource.setInitialCount(0);
    moduleresource.setVfModuleType("vfModuleType");
    moduleresource.setHasVolumeGroup(true);
    return moduleresource;
}
Also used : ModuleResource(org.onap.so.bpmn.core.domain.ModuleResource)

Aggregations

ModuleResource (org.onap.so.bpmn.core.domain.ModuleResource)2 Test (org.junit.Test)1 GroupResource (org.onap.so.bpmn.core.domain.GroupResource)1 Resource (org.onap.so.bpmn.core.domain.Resource)1 VnfResource (org.onap.so.bpmn.core.domain.VnfResource)1 VnfcResource (org.onap.so.bpmn.core.domain.VnfcResource)1