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