diff options
Diffstat (limited to 'catalog-model/src/test/java/org')
-rw-r--r-- | catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java index 28f9fc8652..571a6d4b1f 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java @@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyVertexProperty; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,20 +52,13 @@ public class ToscaElementOperationCatalogTest { private static final String UPDATER_ID = "m08740"; private ArrayList<Vertex> vertexList = new ArrayList<>(); - @Mock - Vertex vertex; - @Mock - Edge edge; - @Mock - Vertex outVertex; - @Mock - Iterator<Edge> edges; - @Mock - JanusGraphDao janusGraphDao; - @Mock - VertexProperty<Object> property; - @Mock - VertexProperty<Object> updaterProperty; + @Mock Edge edge; + @Mock Vertex vertex; + @Mock Vertex outVertex; + @Mock Iterator<Edge> edges; + @Mock JanusGraphDao janusGraphDao; + @Mock VertexProperty<Object> property; + @Mock VertexProperty<Object> updaterProperty; @InjectMocks private ToscaElementOperation toscaOperation = new TopologyTemplateOperation(); @@ -119,4 +113,13 @@ public class ToscaElementOperationCatalogTest { assertEquals(UPDATER_ID, componentList.get(0).getLastUpdaterUserId()); } + @Test + public void thatVertexIsSkippedIfItHasNoMetadataProperty() { + VertexProperty<Object> emptyVertexProperty = new EmptyVertexProperty<>(); + when(vertex.property(GraphPropertiesDictionary.METADATA.getProperty())).thenReturn(emptyVertexProperty); + + List<CatalogComponent> componentList = toscaOperation.getElementCatalogData(true, null).left().value(); + assertEquals(0, componentList.size()); + } + } |