diff options
author | leventecsanyi <levente.csanyi@est.tech> | 2022-10-12 11:51:47 +0200 |
---|---|---|
committer | leventecsanyi <levente.csanyi@est.tech> | 2022-10-17 14:15:26 +0200 |
commit | 69563ed36cd4aa6876aee517c9c228d94e52ba91 (patch) | |
tree | e075f69e5c529448aea7209235c2e704a97804e5 | |
parent | 63093a3a85d2444e54de5db17101810b2e66e21e (diff) |
Fix SonarQube Violations
- Fixed SonarCube issue: added private constructor to TopicValidator and a unit test.
Issue-ID: CPS-475
Change-Id: I4379522f023f32c8999a3ee595392bfbab147050
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
-rw-r--r-- | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java | 3 | ||||
-rw-r--r-- | cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java index 313e7bc012..6a46fbd638 100644 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java @@ -21,8 +21,11 @@ package org.onap.cps.ncmp.rest.util; import java.util.regex.Pattern; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.onap.cps.ncmp.rest.exceptions.InvalidTopicException; +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class TopicValidator { private static final Pattern TOPIC_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9]([._-](?![._-])|" diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy index e626e1505d..15e2c1c6a0 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy @@ -43,5 +43,4 @@ class TopicValidatorSpec extends Specification { 'blank topic' | ' ' 'invalid non empty topic' | '1_5_*_#' } - } |