From b6e7850484ba61df259e38fd6b59e94c2a7de5b6 Mon Sep 17 00:00:00 2001 From: shrikantawachar Date: Mon, 17 Dec 2018 12:26:43 +0530 Subject: API for get all interface lifecycle types API for get all interface lifecycle types Change-Id: I64471c98ff9626ac53562a075a34f506c2e263ab Issue-ID: SDC-1999 Signed-off-by: shrikantawachar --- .../impl/InterfaceLifecycleOperationTest.java | 302 +++++++++++++++++++++ .../operations/impl/InterfaceOperationTest.java | 254 ----------------- 2 files changed, 302 insertions(+), 254 deletions(-) create mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java delete mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java (limited to 'catalog-model/src/test') diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java new file mode 100644 index 0000000000..3e8b087fb2 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java @@ -0,0 +1,302 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.be.model.operations.impl; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import fj.data.Either; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; +import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; +import org.openecomp.sdc.be.dao.titan.TitanGenericDao; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.InterfaceDefinition; +import org.openecomp.sdc.be.model.ModelTestBase; +import org.openecomp.sdc.be.model.Operation; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.model.operations.impl.util.OperationTestsUtil; +import org.openecomp.sdc.be.resources.data.category.CategoryData; +import org.openecomp.sdc.be.resources.data.InterfaceData; +import org.openecomp.sdc.be.resources.data.OperationData; +import org.openecomp.sdc.be.resources.data.UserData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import org.junit.Assert; + +import static org.junit.Assert.assertNotNull; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("classpath:application-context-test.xml") +public class InterfaceLifecycleOperationTest { + private static final Logger log = LoggerFactory.getLogger(InterfaceLifecycleOperationTest.class); + private Gson prettyGson = new GsonBuilder().setPrettyPrinting().create(); + private static String USER_ID = "muUserId"; + private static String CATEGORY_NAME = "category/mycategory"; + + TitanGenericDao titanGenericDao = Mockito.mock(TitanGenericDao.class); + @InjectMocks + private InterfaceLifecycleOperation interfaceLifecycleOperation = new InterfaceLifecycleOperation(); + + @javax.annotation.Resource(name = "property-operation") + private PropertyOperation propertyOperation; + + // @Resource(name = "artifact-operation") + // private ArtifactOperation artifactOperation; + + @Before + public void createUserAndCategory() { + MockitoAnnotations.initMocks(this); + final String UNIQUE_ID = "UNIQUE_ID"; + CategoryData categoryData = new CategoryData(NodeTypeEnum.ResourceCategory); + when(titanGenericDao.createNode(any(),any())).thenReturn(Either.left(categoryData)); + deleteAndCreateCategory(CATEGORY_NAME); + deleteAndCreateUser(USER_ID, "first_" + USER_ID, "last_" + USER_ID); + } + + @BeforeClass + public static void setupBeforeClass() { + // ExternalConfiguration.setAppName("catalog-model"); + // String appConfigDir = "src/test/resources/config/catalog-model"; + // ConfigurationSource configurationSource = new + // FSConfigurationSource(ExternalConfiguration.getChangeListener(), + // appConfigDir); + + ModelTestBase.init(); + + } + + @Test + public void testDummy() { + + assertNotNull(interfaceLifecycleOperation); + + } + +/* @Test + public void addInterfaceToResourceTest() { + + String capabilityTypeName = "mycapability1"; + String reqName = "host"; + String reqNodeName = "tosca.nodes.Compute1"; + String rootName = "Root100"; + String softwareCompName = "tosca.nodes.SoftwareComponent"; + String computeNodeName = "tosca.nodes.Compute"; + String myResourceVersion = "300.0"; + String reqRelationship = "myrelationship"; + + ResourceOperationTest resourceOperationTest = new ResourceOperationTest(); + resourceOperationTest.setOperations(titanDao, resourceOperation, propertyOperation); + + Resource rootResource = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, rootName, "100.0", null, true, true); + + String interfaceName = "standard"; + InterfaceDefinition interfaceDefinition = buildInterfaceDefinition(); + + Operation op = buildOperationDefinition(); + Map operations = new HashMap(); + operations.put("Create", op); + interfaceDefinition.setOperations(operations); + + Either result = interfaceOperation.addInterfaceToResource(interfaceDefinition, rootResource.getUniqueId(), "standard"); + + assertTrue(result.isLeft()); + log.debug("{}", result.left().value()); + + Either getResourceRes = resourceOperation.getResource(rootResource.getUniqueId()); + assertTrue(getResourceRes.isLeft()); + Resource resourceWithInterface = getResourceRes.left().value(); + Map interfaces = resourceWithInterface.getInterfaces(); + assertNotNull(interfaces); + assertFalse(interfaces.isEmpty()); + InterfaceDefinition interfaceDefinition2 = interfaces.get(interfaceName); + assertNotNull(interfaceDefinition2.getOperations()); + assertFalse(interfaceDefinition2.getOperations().isEmpty()); + + } + + @Test + public void updateInterfaceToResourceTest() { + + String reqName = "host"; + String rootName = "Root200"; + String softwareCompName = "tosca.nodes.SoftwareComponent"; + + ResourceOperationTest resourceOperationTest = new ResourceOperationTest(); + resourceOperationTest.setOperations(titanDao, resourceOperation, propertyOperation); + + Resource rootResource = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, rootName, "200.0", null, true, true); + + String interfaceName = "standard"; + InterfaceDefinition interfaceDefinition = buildInterfaceDefinition(); + + Operation op = buildOperationDefinition(); + Map operations = new HashMap(); + operations.put("create", op); + interfaceDefinition.setOperations(operations); + + Either result = interfaceOperation.addInterfaceToResource(interfaceDefinition, rootResource.getUniqueId(), "standard"); + + ResourceMetadataData resourceData = new ResourceMetadataData(); + resourceData.getMetadataDataDefinition().setUniqueId(rootResource.getUniqueId()); + resourceData.getMetadataDataDefinition().setState(LifecycleStateEnum.CERTIFIED.name()); + Either updateNode = titanDao.updateNode(resourceData, ResourceMetadataData.class); + assertTrue(updateNode.isLeft()); + + Either fetchRootResource = resourceOperation.getResource(rootResource.getUniqueId()); + + assertTrue(fetchRootResource.isLeft()); + String rootResourceJson = prettyGson.toJson(fetchRootResource.left().value()); + log.debug(rootResourceJson); + + Resource softwareComponent = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, softwareCompName, "400.0", rootResource.getName(), true, true); + + assertTrue(result.isLeft()); + log.debug("{}", result.left().value()); + + addImplementationToOperation(op); + // String resourceId, String interfaceName, String + // operationName,Operation interf + + Either opResult = interfaceOperation.updateInterfaceOperation(softwareComponent.getUniqueId(), "standard", "create", op); + // PrintGraph pg = new PrintGraph(); + // System.out.println(pg.buildGraphForWebgraphWiz(titanDao.getGraph().left().value())); + assertTrue(opResult.isLeft()); + log.debug("{}", opResult.left().value()); + + Either getResourceRes = resourceOperation.getResource(softwareComponent.getUniqueId()); + assertTrue(getResourceRes.isLeft()); + Resource resourceWithInterface = getResourceRes.left().value(); + Map interfaces = resourceWithInterface.getInterfaces(); + assertNotNull(interfaces); + assertFalse(interfaces.isEmpty()); + InterfaceDefinition interfaceDefinition2 = interfaces.get(interfaceName); + assertNotNull(interfaceDefinition2.getOperations()); + assertFalse(interfaceDefinition2.getOperations().isEmpty()); + Operation operation = interfaceDefinition2.getOperations().get("create"); + assertNotNull(operation); + assertNotNull(operation.getImplementation()); + } +*/ + private void addImplementationToOperation(Operation op) { + ArtifactDataDefinition artifactDataDef = new ArtifactDataDefinition(); + artifactDataDef.setArtifactChecksum("YTg2Mjg4MWJhNmI5NzBiNzdDFkMWI="); + artifactDataDef.setArtifactName("create_myRoot.sh"); + artifactDataDef.setArtifactLabel("create_myRoot"); + artifactDataDef.setArtifactType("SHELL"); + artifactDataDef.setDescription("good description"); + artifactDataDef.setEsId("esId"); + artifactDataDef.setUniqueId(op.getUniqueId() + "." + artifactDataDef.getArtifactLabel()); + ArtifactDefinition artifactDef = new ArtifactDefinition(artifactDataDef, "UEsDBAoAAAAIAAeLb0bDQz"); + op.setImplementation(artifactDef); + } + + private InterfaceDefinition buildInterfaceDefinition() { + InterfaceDefinition interfaceDefinition = new InterfaceDefinition(); + interfaceDefinition.setType("tosca.interfaces.standard"); + interfaceDefinition.setCreationDate(new Long(101232)); + + return interfaceDefinition; + } + + private Operation buildOperationDefinition() { + Operation op = new Operation(); + op.setCreationDate(new Long(101232)); + op.setDescription("asda"); + + return op; + } + + private void deleteAndCreateCategory(String category) { + String[] names = category.split("/"); + OperationTestsUtil.deleteAndCreateResourceCategory(names[0], names[1], titanGenericDao); + + /* + * CategoryData categoryData = new CategoryData(); categoryData.setName(category); + * + * titanDao.deleteNode(categoryData, CategoryData.class); Either createNode = titanDao .createNode(categoryData, CategoryData.class); System.out.println("after creating caetgory " + createNode); + */ + + } + + private UserData deleteAndCreateUser(String userId, String firstName, String lastName) { + UserData userData = new UserData(); + userData.setUserId(userId); + userData.setFirstName(firstName); + userData.setLastName(lastName); + + titanGenericDao.deleteNode(UniqueIdBuilder.getKeyByNodeType(NodeTypeEnum.User), userId, + UserData.class); + titanGenericDao.createNode(userData, UserData.class); + titanGenericDao.commit(); + + return userData; + } + + @Test + public void testGetAllInterfaceLifecycleTypes_TypesNotFound() { + when(titanGenericDao.getByCriteria(NodeTypeEnum.Interface, Collections.emptyMap(), + InterfaceData.class)).thenReturn(Either.right(TitanOperationStatus.NOT_FOUND)); + Either, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes(); + Assert.assertEquals(types.isRight(), Boolean.TRUE); + } + + @Test + public void testGetAllInterfaceLifecycleTypes_Success() { + final String UNIQUE_ID = "UNIQUE_ID"; + final String TYPE = "UNIQUE_ID"; + InterfaceData interfaceData = new InterfaceData(); + interfaceData.getInterfaceDataDefinition().setUniqueId(UNIQUE_ID); + interfaceData.getInterfaceDataDefinition().setType(TYPE); + List interfaceDataList = new ArrayList<>(); + interfaceDataList.add(interfaceData); + Either, TitanOperationStatus> allInterfaceTypes = Either.left(interfaceDataList); + when(titanGenericDao.getByCriteria(NodeTypeEnum.Interface, Collections.emptyMap(), InterfaceData.class)).thenReturn(allInterfaceTypes); + + List> list = new ArrayList<>(); + Either>, TitanOperationStatus> childrenNodes = Either.left(list); + when(titanGenericDao.getChildrenNodes(interfaceData.getUniqueIdKey(), interfaceData.getUniqueId(), GraphEdgeLabels.INTERFACE_OPERATION, NodeTypeEnum.InterfaceOperation, OperationData.class)).thenReturn(childrenNodes); + + Either, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes(); + Assert.assertEquals(types.left().value().size(),1); + } + +} diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java deleted file mode 100644 index a50435b30c..0000000000 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java +++ /dev/null @@ -1,254 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.be.model.operations.impl; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openecomp.sdc.be.dao.titan.TitanGenericDao; -import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.InterfaceDefinition; -import org.openecomp.sdc.be.model.ModelTestBase; -import org.openecomp.sdc.be.model.Operation; -import org.openecomp.sdc.be.model.operations.impl.util.OperationTestsUtil; -import org.openecomp.sdc.be.resources.data.UserData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("classpath:application-context-test.xml") -public class InterfaceOperationTest { - private static final Logger log = LoggerFactory.getLogger(InterfaceOperationTest.class); - private Gson prettyGson = new GsonBuilder().setPrettyPrinting().create(); - - private static String USER_ID = "muUserId"; - private static String CATEGORY_NAME = "category/mycategory"; - // InterfaceLifecycleOperation interfaceOperation = new - // InterfaceLifecycleOperation(); - - // TitanGenericDao titanGenericDao = Mockito.mock(TitanGenericDao.class); - @javax.annotation.Resource(name = "titan-generic-dao") - private TitanGenericDao titanDao; - - @javax.annotation.Resource(name = "interface-operation") - private InterfaceLifecycleOperation interfaceOperation; - - @javax.annotation.Resource(name = "property-operation") - private PropertyOperation propertyOperation; - - // @Resource(name = "artifact-operation") - // private ArtifactOperation artifactOperation; - - @Before - public void createUserAndCategory() { - deleteAndCreateCategory(CATEGORY_NAME); - deleteAndCreateUser(USER_ID, "first_" + USER_ID, "last_" + USER_ID); - } - - @BeforeClass - public static void setupBeforeClass() { - // ExternalConfiguration.setAppName("catalog-model"); - // String appConfigDir = "src/test/resources/config/catalog-model"; - // ConfigurationSource configurationSource = new - // FSConfigurationSource(ExternalConfiguration.getChangeListener(), - // appConfigDir); - - ModelTestBase.init(); - - } - - @Test - public void testDummy() { - - assertNotNull(interfaceOperation); - - } - -/* @Test - public void addInterfaceToResourceTest() { - - String capabilityTypeName = "mycapability1"; - String reqName = "host"; - String reqNodeName = "tosca.nodes.Compute1"; - String rootName = "Root100"; - String softwareCompName = "tosca.nodes.SoftwareComponent"; - String computeNodeName = "tosca.nodes.Compute"; - String myResourceVersion = "300.0"; - String reqRelationship = "myrelationship"; - - ResourceOperationTest resourceOperationTest = new ResourceOperationTest(); - resourceOperationTest.setOperations(titanDao, resourceOperation, propertyOperation); - - Resource rootResource = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, rootName, "100.0", null, true, true); - - String interfaceName = "standard"; - InterfaceDefinition interfaceDefinition = buildInterfaceDefinition(); - - Operation op = buildOperationDefinition(); - Map operations = new HashMap(); - operations.put("Create", op); - interfaceDefinition.setOperations(operations); - - Either result = interfaceOperation.addInterfaceToResource(interfaceDefinition, rootResource.getUniqueId(), "standard"); - - assertTrue(result.isLeft()); - log.debug("{}", result.left().value()); - - Either getResourceRes = resourceOperation.getResource(rootResource.getUniqueId()); - assertTrue(getResourceRes.isLeft()); - Resource resourceWithInterface = getResourceRes.left().value(); - Map interfaces = resourceWithInterface.getInterfaces(); - assertNotNull(interfaces); - assertFalse(interfaces.isEmpty()); - InterfaceDefinition interfaceDefinition2 = interfaces.get(interfaceName); - assertNotNull(interfaceDefinition2.getOperations()); - assertFalse(interfaceDefinition2.getOperations().isEmpty()); - - } - - @Test - public void updateInterfaceToResourceTest() { - - String reqName = "host"; - String rootName = "Root200"; - String softwareCompName = "tosca.nodes.SoftwareComponent"; - - ResourceOperationTest resourceOperationTest = new ResourceOperationTest(); - resourceOperationTest.setOperations(titanDao, resourceOperation, propertyOperation); - - Resource rootResource = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, rootName, "200.0", null, true, true); - - String interfaceName = "standard"; - InterfaceDefinition interfaceDefinition = buildInterfaceDefinition(); - - Operation op = buildOperationDefinition(); - Map operations = new HashMap(); - operations.put("create", op); - interfaceDefinition.setOperations(operations); - - Either result = interfaceOperation.addInterfaceToResource(interfaceDefinition, rootResource.getUniqueId(), "standard"); - - ResourceMetadataData resourceData = new ResourceMetadataData(); - resourceData.getMetadataDataDefinition().setUniqueId(rootResource.getUniqueId()); - resourceData.getMetadataDataDefinition().setState(LifecycleStateEnum.CERTIFIED.name()); - Either updateNode = titanDao.updateNode(resourceData, ResourceMetadataData.class); - assertTrue(updateNode.isLeft()); - - Either fetchRootResource = resourceOperation.getResource(rootResource.getUniqueId()); - - assertTrue(fetchRootResource.isLeft()); - String rootResourceJson = prettyGson.toJson(fetchRootResource.left().value()); - log.debug(rootResourceJson); - - Resource softwareComponent = resourceOperationTest.createResource(USER_ID, CATEGORY_NAME, softwareCompName, "400.0", rootResource.getName(), true, true); - - assertTrue(result.isLeft()); - log.debug("{}", result.left().value()); - - addImplementationToOperation(op); - // String resourceId, String interfaceName, String - // operationName,Operation interf - - Either opResult = interfaceOperation.updateInterfaceOperation(softwareComponent.getUniqueId(), "standard", "create", op); - // PrintGraph pg = new PrintGraph(); - // System.out.println(pg.buildGraphForWebgraphWiz(titanDao.getGraph().left().value())); - assertTrue(opResult.isLeft()); - log.debug("{}", opResult.left().value()); - - Either getResourceRes = resourceOperation.getResource(softwareComponent.getUniqueId()); - assertTrue(getResourceRes.isLeft()); - Resource resourceWithInterface = getResourceRes.left().value(); - Map interfaces = resourceWithInterface.getInterfaces(); - assertNotNull(interfaces); - assertFalse(interfaces.isEmpty()); - InterfaceDefinition interfaceDefinition2 = interfaces.get(interfaceName); - assertNotNull(interfaceDefinition2.getOperations()); - assertFalse(interfaceDefinition2.getOperations().isEmpty()); - Operation operation = interfaceDefinition2.getOperations().get("create"); - assertNotNull(operation); - assertNotNull(operation.getImplementation()); - } -*/ - private void addImplementationToOperation(Operation op) { - ArtifactDataDefinition artifactDataDef = new ArtifactDataDefinition(); - artifactDataDef.setArtifactChecksum("YTg2Mjg4MWJhNmI5NzBiNzdDFkMWI="); - artifactDataDef.setArtifactName("create_myRoot.sh"); - artifactDataDef.setArtifactLabel("create_myRoot"); - artifactDataDef.setArtifactType("SHELL"); - artifactDataDef.setDescription("good description"); - artifactDataDef.setEsId("esId"); - artifactDataDef.setUniqueId(op.getUniqueId() + "." + artifactDataDef.getArtifactLabel()); - ArtifactDefinition artifactDef = new ArtifactDefinition(artifactDataDef, "UEsDBAoAAAAIAAeLb0bDQz"); - op.setImplementation(artifactDef); - } - - private InterfaceDefinition buildInterfaceDefinition() { - InterfaceDefinition interfaceDefinition = new InterfaceDefinition(); - interfaceDefinition.setType("tosca.interfaces.standard"); - interfaceDefinition.setCreationDate(new Long(101232)); - - return interfaceDefinition; - } - - private Operation buildOperationDefinition() { - Operation op = new Operation(); - op.setCreationDate(new Long(101232)); - op.setDescription("asda"); - - return op; - } - - private void deleteAndCreateCategory(String category) { - String[] names = category.split("/"); - OperationTestsUtil.deleteAndCreateResourceCategory(names[0], names[1], titanDao); - - /* - * CategoryData categoryData = new CategoryData(); categoryData.setName(category); - * - * titanDao.deleteNode(categoryData, CategoryData.class); Either createNode = titanDao .createNode(categoryData, CategoryData.class); System.out.println("after creating caetgory " + createNode); - */ - - } - - private UserData deleteAndCreateUser(String userId, String firstName, String lastName) { - UserData userData = new UserData(); - userData.setUserId(userId); - userData.setFirstName(firstName); - userData.setLastName(lastName); - - titanDao.deleteNode(UniqueIdBuilder.getKeyByNodeType(NodeTypeEnum.User), userId, UserData.class); - titanDao.createNode(userData, UserData.class); - titanDao.commit(); - - return userData; - } - -} -- cgit 1.2.3-korg