Fix SonarQube Violations 84/131484/3
authorleventecsanyi <levente.csanyi@est.tech>
Wed, 12 Oct 2022 09:51:47 +0000 (11:51 +0200)
committerleventecsanyi <levente.csanyi@est.tech>
Mon, 17 Oct 2022 12:15:26 +0000 (14:15 +0200)
- 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>
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/TopicValidator.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/util/TopicValidatorSpec.groovy

index 313e7bc..6a46fbd 100644 (file)
 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]([._-](?![._-])|"
index e626e15..15e2c1c 100644 (file)
@@ -43,5 +43,4 @@ class TopicValidatorSpec extends Specification {
             'blank topic'             | ' '
             'invalid non empty topic' | '1_5_*_#'
     }
-
 }