diff options
author | sourabh_sourabh <sourabh.sourabh@est.tech> | 2022-03-28 13:21:55 +0100 |
---|---|---|
committer | sourabh_sourabh <sourabh.sourabh@est.tech> | 2022-04-05 20:38:50 +0100 |
commit | ea01d09861289ff162dff318713d1c24eba89259 (patch) | |
tree | 01498ec770966c177b74700dd696a4290b8ad275 /cps-service/src/test | |
parent | d69742c1f02585ae5d82f49542581698367e9cde (diff) |
Async: NCMP Rest impl. including Request ID generation
- Restructured code and moved some of them at controller and service
layer.
- Unit is fixed and organized to it's belonging classes.
Issue-ID: CPS-828
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Change-Id: I0919218e35b1d11cb579d707f376b76de80409da
Diffstat (limited to 'cps-service/src/test')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/utils/CpsValidatorSpec.groovy | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/CpsValidatorSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/CpsValidatorSpec.groovy index 191472ceea..ce728ef1c1 100644 --- a/cps-service/src/test/groovy/org/onap/cps/utils/CpsValidatorSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/utils/CpsValidatorSpec.groovy @@ -45,4 +45,18 @@ class CpsValidatorSpec extends Specification { 'position 5' | 'name with spaces' || 'name with spaces invalid token encountered at position 5' 'position 9' | 'nameWith Space' || 'nameWith Space invalid token encountered at position 9' } + + def 'Validating topic names.'() { + when: 'the topic name is validated' + def isValidTopicName = CpsValidator.validateTopicName(topicName) + then: 'boolean response will be returned for #scenario' + assert isValidTopicName == booleanResponse + where: 'the following names are used' + scenario | topicName || booleanResponse + 'valid topic' | 'my-topic-name' || true + 'empty topic' | '' || false + 'blank topic' | ' ' || false + 'null topic' | null || false + 'invalid non empty topic' | '1_5_*_#' || false + } } |