diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-06-20 14:59:26 +0100 |
---|---|---|
committer | andre.schmid <andre.schmid@est.tech> | 2022-06-20 14:59:26 +0100 |
commit | ce3e2816ec3aa034bdef323c1a33b71485e87eb0 (patch) | |
tree | 06a0a2a442c1662dc7e646c7f3217eb390cc4f31 /catalog-model/src/test/java | |
parent | 097ca1640d7fe865649827635118bfa633fed805 (diff) |
Allow to delete an interface operation from VFC
Issue-ID: SDC-4055
Change-Id: I43e79315dce12e2060f8b1dbdfcae29da46fc02e
Signed-off-by: stasys10 <stasys.jurgaitis@est.tech>
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-model/src/test/java')
-rw-r--r-- | catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/InterfaceOperationTest.java | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/InterfaceOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/InterfaceOperationTest.java index 7353c511db..44d0fbdf1e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/InterfaceOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/InterfaceOperationTest.java @@ -357,10 +357,7 @@ public class InterfaceOperationTest extends ModelTestBase { private void testAddSingleInterface(Component component) { InterfaceDefinition interfaceDefinition = buildInterfaceDefinition("1"); - Either<List<InterfaceDefinition>, StorageOperationStatus> res = interfaceOperation - .addInterfaces(component.getUniqueId(), - Collections.singletonList( - interfaceDefinition)); + final var res = interfaceOperation.addInterfaces(component, Collections.singletonList(interfaceDefinition)); Assert.assertTrue(res.isLeft()); Assert.assertEquals("1", res.left().value().get(0).getUniqueId()); } @@ -398,8 +395,7 @@ public class InterfaceOperationTest extends ModelTestBase { List<InterfaceDefinition> interfaceDefinitions = new ArrayList<>(); interfaceDefinitions.add(interfaceDefinition1); interfaceDefinitions.add(interfaceDefinition2); - Either<List<InterfaceDefinition>, StorageOperationStatus> res = - interfaceOperation.addInterfaces(component.getUniqueId(), interfaceDefinitions); + final var res = interfaceOperation.addInterfaces(component, interfaceDefinitions); Assert.assertTrue(res.isLeft()); Assert.assertEquals(2, res.left().value().size()); } @@ -411,17 +407,13 @@ public class InterfaceOperationTest extends ModelTestBase { private void testUpdateInterface(Component component) { InterfaceDefinition interfaceDefinition = buildInterfaceDefinition("1"); - Either<List<InterfaceDefinition>, StorageOperationStatus> res = interfaceOperation - .addInterfaces(component.getUniqueId(), - Collections.singletonList( - interfaceDefinition)); + var res = interfaceOperation.addInterfaces(component, Collections.singletonList(interfaceDefinition)); Assert.assertTrue(res.isLeft()); List<InterfaceDefinition> value = res.left().value(); InterfaceDefinition createdInterfaceDef = value.get(0); String newDescription = "New Description"; createdInterfaceDef.setDescription(newDescription); - res = interfaceOperation - .updateInterfaces(component.getUniqueId(), Collections.singletonList(createdInterfaceDef)); + res = interfaceOperation.updateInterfaces(component, Collections.singletonList(createdInterfaceDef)); assertTrue(res.isLeft()); assertEquals(newDescription, res.left().value().get(0).getDescription()); } @@ -438,14 +430,10 @@ public class InterfaceOperationTest extends ModelTestBase { private void testDeleteInterface(Component component) { InterfaceDefinition interfaceDefinition = buildInterfaceDefinition("1"); - Either<List<InterfaceDefinition>, StorageOperationStatus> res = interfaceOperation - .addInterfaces(component.getUniqueId(), - Collections.singletonList( - interfaceDefinition)); + var res = interfaceOperation.addInterfaces(component, Collections.singletonList(interfaceDefinition)); Assert.assertTrue(res.isLeft()); List<InterfaceDefinition> value = res.left().value(); - Either<String, StorageOperationStatus> deleteInterfaceOperationRes = - interfaceOperation.deleteInterface(component.getUniqueId(), value.get(0).getUniqueId()); + final var deleteInterfaceOperationRes = interfaceOperation.deleteInterface(component, value.get(0).getUniqueId()); assertTrue(deleteInterfaceOperationRes.isLeft()); } @@ -459,8 +447,7 @@ public class InterfaceOperationTest extends ModelTestBase { Component component = createResource(); InterfaceDefinition interfaceDefinition = buildInterfaceDefinitionWithoutOperation(); interfaceDefinition.setOperationsMap(createMockOperationMap()); - Either<List<InterfaceDefinition>, StorageOperationStatus> res = interfaceOperation.updateInterfaces( - component.getUniqueId(), Collections.singletonList(interfaceDefinition)); + final var res = interfaceOperation.updateInterfaces(component, Collections.singletonList(interfaceDefinition)); Assert.assertTrue(res.isRight()); } |