Search in sources :

Example 1 with Project

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

the class BuildingBlockTestDataSetup method buildProject.

public Project buildProject() {
    projectCounter++;
    Project project = new Project();
    project.setProjectName("testProjectName" + projectCounter);
    return project;
}
Also used : Project(org.onap.so.bpmn.servicedecomposition.bbobjects.Project)

Example 2 with Project

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

the class BBInputSetupMapperLayerTest method testMapAAIProject.

@Test
public void testMapAAIProject() throws IOException {
    Project expected = mapper.readValue(new File(RESOURCE_PATH + "Project.json"), Project.class);
    org.onap.aai.domain.yang.Project projectAAI = new org.onap.aai.domain.yang.Project();
    projectAAI.setProjectName("projectName");
    Project actual = bbInputSetupMapperLayer.mapAAIProject(projectAAI);
    assertThat(actual, sameBeanAs(expected));
}
Also used : Project(org.onap.so.bpmn.servicedecomposition.bbobjects.Project) File(java.io.File) Test(org.junit.Test)

Example 3 with Project

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

the class BBInputSetupTest method testMapProject.

@Test
public void testMapProject() throws JsonProcessingException {
    org.onap.aai.domain.yang.Project expectedAAI = new org.onap.aai.domain.yang.Project();
    Project expected = new Project();
    AAIResultWrapper vnfWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI));
    doReturn(expected).when(bbInputSetupMapperLayer).mapAAIProject(isA(org.onap.aai.domain.yang.Project.class));
    ServiceInstance serviceInstance = new ServiceInstance();
    SPY_bbInputSetup.mapProject(Arrays.asList(new AAIResultWrapper[] { vnfWrapper }), serviceInstance);
    assertEquals(expected, serviceInstance.getProject());
}
Also used : Project(org.onap.so.bpmn.servicedecomposition.bbobjects.Project) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) AAICommonObjectMapperProvider(org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider) AAIResultWrapper(org.onap.aaiclient.client.aai.entities.AAIResultWrapper) Test(org.junit.Test)

Example 4 with Project

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

the class AAIObjectMapperTest method projectMap.

@Test
public void projectMap() {
    Project project = new Project();
    project.setProjectName("abc");
    org.onap.aai.domain.yang.Project AAIProject = aaiObjectMapper.mapProject(project);
    assertEquals(AAIProject.getProjectName(), project.getProjectName());
}
Also used : Project(org.onap.so.bpmn.servicedecomposition.bbobjects.Project) Test(org.junit.Test)

Example 5 with Project

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

the class BBInputSetup method mapProject.

protected void mapProject(List<AAIResultWrapper> projects, ServiceInstance serviceInstance) {
    if (!projects.isEmpty()) {
        AAIResultWrapper projectWrapper = projects.get(0);
        Optional<org.onap.aai.domain.yang.Project> aaiProjectOp = projectWrapper.asBean(org.onap.aai.domain.yang.Project.class);
        if (aaiProjectOp.isPresent()) {
            Project project = this.mapperLayer.mapAAIProject(aaiProjectOp.get());
            serviceInstance.setProject(project);
        }
    }
}
Also used : Project(org.onap.so.bpmn.servicedecomposition.bbobjects.Project) AAIResultWrapper(org.onap.aaiclient.client.aai.entities.AAIResultWrapper)

Aggregations

Project (org.onap.so.bpmn.servicedecomposition.bbobjects.Project)12 Test (org.junit.Test)7 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)6 File (java.io.File)5 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)4 OwningEntity (org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity)4 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)4 Service (org.onap.so.db.catalog.beans.Service)4 HashMap (java.util.HashMap)3 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)3 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)3 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)3 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)3 AAIResultWrapper (org.onap.aaiclient.client.aai.entities.AAIResultWrapper)2 ServiceSubscription (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription)2 AAICommonObjectMapperProvider (org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider)1 AAIFluentTypeBuilder (org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder)1 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)1 NoServiceInstanceFoundException (org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException)1 ResourceNotFoundException (org.onap.so.bpmn.servicedecomposition.tasks.exceptions.ResourceNotFoundException)1