Add 'direct' keyword to descendants option to query direct children (ep1)
[cps.git] / cps-service / src / test / groovy / org / onap / cps / spi / FetchDescendantsOptionSpec.groovy
index 24f3487..b095bfd 100644 (file)
@@ -85,6 +85,8 @@ class FetchDescendantsOptionSpec extends Specification {
             'all descendants using all'         | 'all'                          || -1
             'No descendants by default'         | ''                             || 0
             'No descendants using none'         | 'none'                         || 0
+            'direct child using number'         | '1'                            || 1
+            'direct child using direct'         | 'direct'                       || 1
             'til 10th descendants using number' | '10'                           || 10
     }
 
@@ -94,7 +96,7 @@ class FetchDescendantsOptionSpec extends Specification {
         where: 'the following option is used'
             fetchDescendantsOption                         || expectedStringValue
             FetchDescendantsOption.OMIT_DESCENDANTS        || 'OmitDescendants'
-            FetchDescendantsOption.DIRECT_CHILDREN_ONLY    || 'DirectChildrenOnly'
+            FetchDescendantsOption.DIRECT_CHILD_ONLY       || 'DirectChildOnly'
             FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS || 'IncludeAllDescendants'
             new FetchDescendantsOption(2)                  || 'Depth=2'
     }