summaryrefslogtreecommitdiffstats
path: root/common/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/test')
-rw-r--r--common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
index a156e3c158..a5bbc64eb9 100644
--- a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
@@ -21,6 +21,7 @@
package org.onap.so.client.aai;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.so.client.graphinventory.entities.DSLNode;
@@ -89,4 +90,23 @@ public class DSLQueryBuilderTest {
builder.to(AAIObjectType.P_INTERFACE).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
assertEquals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id')", builder.build());
}
+
+ @Test
+ public void limitTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.PSERVER,
+ __.key("hostname", "my-hostname")).output());
+
+ builder.to(AAIObjectType.P_INTERFACE).limit(2).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
+ assertEquals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id') LIMIT 2", builder.build());
+ }
+
+ @Test
+ public void equalsTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.PSERVER,
+ __.key("hostname", "my-hostname")).output());
+
+ builder.to(AAIObjectType.P_INTERFACE).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
+ assertTrue(builder.equals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id')"));
+ assertTrue(builder.equals(builder));
+ }
}