summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/java/org
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2020-10-14 20:56:11 +0100
committerS�bastien Determe <sebastien.determe@intl.att.com>2020-12-07 14:51:59 +0000
commit95ad93091d5fa6e377e76f312d495151bddc9da8 (patch)
tree9923a98bd90b99cb960cf1f7ead2a57402aca1a8 /catalog-model/src/test/java/org
parenta9467feb90c33ad5b6b2ed80581c4adf75114046 (diff)
Support interface input during import VFC
Change-Id: I097ce258a7dadbedf1aff6ce53dd1286da074552 Issue-ID: SDC-3372 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-model/src/test/java/org')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java71
1 files changed, 30 insertions, 41 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java
index 992ae9bae8..43761b3369 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java
@@ -20,64 +20,53 @@
package org.openecomp.sdc.be.model;
-import org.junit.Test;
-import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
+import org.junit.jupiter.api.Test;
+import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
-public class InterfaceDefinitionTest {
-
- private InterfaceDefinition createTestSubject() {
- return new InterfaceDefinition();
- }
+class InterfaceDefinitionTest {
@Test
- public void testCtor() throws Exception {
+ void testCtor() throws Exception {
new InterfaceDefinition(new InterfaceDataDefinition());
new InterfaceDefinition("mock", "mock", new HashMap<>());
}
@Test
- public void testIsDefinition() throws Exception {
- InterfaceDefinition testSubject;
- boolean result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.isDefinition();
+ void testIsDefinition() {
+ final InterfaceDefinition interfaceDefinition = new InterfaceDefinition();
+ assertFalse(interfaceDefinition.isDefinition());
}
@Test
- public void testSetDefinition() throws Exception {
- InterfaceDefinition testSubject;
- boolean definition = false;
-
- // default test
- testSubject = createTestSubject();
- testSubject.setDefinition(definition);
+ void testGetOperationsMap() {
+ final InterfaceDefinition interfaceDefinition = new InterfaceDefinition();
+ assertNotNull(interfaceDefinition.getOperationsMap());
+ assertTrue(interfaceDefinition.getOperationsMap().isEmpty());
}
@Test
- public void testGetOperationsMap() throws Exception {
- InterfaceDefinition testSubject;
- Map<String, Operation> result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getOperationsMap();
- }
-
-
-
- @Test
- public void testToString() throws Exception {
- InterfaceDefinition testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.toString();
+ void testHasOperation() {
+ final InterfaceDefinition interfaceDefinition = new InterfaceDefinition();
+ final Map<String, Operation> operationMap = new HashMap<>();
+ final Set<String> operationSet = new HashSet<>();
+ operationSet.add("operation1");
+ operationSet.add("operation2");
+ operationSet.add("operation3");
+ operationSet.forEach(operation -> operationMap.put(operation, new Operation()));
+ interfaceDefinition.setOperationsMap(operationMap);
+
+ operationSet.forEach(operation -> assertThat(String.format("Should contain operation: %s", operation),
+ interfaceDefinition.hasOperation(operation), is(true)));
}
}