summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/test/groovy/org
diff options
context:
space:
mode:
authorLuke Gleeson <luke.gleeson@est.tech>2023-08-03 13:13:47 +0000
committerGerrit Code Review <gerrit@onap.org>2023-08-03 13:13:47 +0000
commit478c5dac54ed508f0ce97e18e91aac7b821d814f (patch)
tree6b8d3d25972ebacf2d429ede2fff601cce15bc2e /cps-ri/src/test/groovy/org
parent2a1e576e6d12456e43c47d4cd81be7f88d1a2a2b (diff)
parentf248b5d9b794d5bdff59145406e0398d6fdcafa4 (diff)
Merge "Support pagination in query across all anchors(ep4)"
Diffstat (limited to 'cps-ri/src/test/groovy/org')
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/utils/CpsValidatorSpec.groovy10
1 files changed, 10 insertions, 0 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/utils/CpsValidatorSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/utils/CpsValidatorSpec.groovy
index 345089c931..8d348443c7 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/utils/CpsValidatorSpec.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/utils/CpsValidatorSpec.groovy
@@ -20,6 +20,7 @@
package org.onap.cps.spi.impl.utils
+import org.onap.cps.spi.PaginationOption
import org.onap.cps.spi.exceptions.DataValidationException
import spock.lang.Specification
@@ -64,4 +65,13 @@ class CpsValidatorSpec extends Specification {
then: 'a data validation exception is thrown'
thrown(DataValidationException)
}
+
+ def 'Validate Pagination option with invalid page index and size.'() {
+ when: 'the pagination option is validated using invalid options'
+ objectUnderTest.validatePaginationOption(new PaginationOption(-5, -2))
+ then: 'a data validation exception is thrown'
+ def exceptionThrown = thrown(DataValidationException)
+ and: 'the error was encountered at the following index in #scenario'
+ assert exceptionThrown.getDetails().contains("Invalid page index or size")
+ }
}