From b7359210ff315cf9b1daf251da452fb48217b051 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Thu, 14 Jan 2021 11:29:40 +0000 Subject: SonarQube fixes - Ignore SonarQube violations related to inheritance depth for exception classes - Increase coverage service module Issue-ID: CPS-89 Signed-off-by: ToineSiebelink Change-Id: I7998dee0f9abea0638639e0587b08febad6075f5 --- .../org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java | 5 +++++ .../onap/cps/spi/exceptions/DataspaceAlreadyDefinedException.java | 2 ++ .../org/onap/cps/spi/exceptions/DataspaceNotFoundException.java | 3 ++- .../org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java | 5 ++--- .../onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java | 3 +++ .../org/onap/cps/spi/exceptions/SchemaSetNotFoundException.java | 7 ++++++- 6 files changed, 20 insertions(+), 5 deletions(-) (limited to 'cps-service/src/main/java/org') diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java index efdb86e970..2a4abad319 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java @@ -19,6 +19,11 @@ package org.onap.cps.spi.exceptions; +/** + * Anchor already defined exception. Indicates the an anchor with same name already exists in the same dataspace + */ + +@SuppressWarnings("squid:S110") // Team agreed to accept 6 levels of inheritance for CPS Exceptions public class AnchorAlreadyDefinedException extends CpsAdminException { private static final long serialVersionUID = 5744381546778730691L; diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceAlreadyDefinedException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceAlreadyDefinedException.java index d6d933c66e..fcc085aa08 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceAlreadyDefinedException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceAlreadyDefinedException.java @@ -22,6 +22,8 @@ package org.onap.cps.spi.exceptions; /** * Dataspace already defined exception. Indicates the dataspace with same name already exists. */ + +@SuppressWarnings("squid:S110") // Team agreed to accept 6 levels of inheritance for CPS Exceptions public class DataspaceAlreadyDefinedException extends CpsAdminException { private static final long serialVersionUID = -5813793951842079228L; diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceNotFoundException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceNotFoundException.java index 58fcde3d14..42b77a23be 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceNotFoundException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceNotFoundException.java @@ -19,10 +19,11 @@ package org.onap.cps.spi.exceptions; - /** * Dataspace Not Found Exception. Indicates the requested data being absent. */ + +@SuppressWarnings("squid:S110") // Team agreed to accept 6 levels of inheritance for CPS Exceptions public class DataspaceNotFoundException extends CpsAdminException { private static final long serialVersionUID = -1852996415384288431L; diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java index 66cce1bfce..56a2f87433 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java @@ -19,12 +19,11 @@ package org.onap.cps.spi.exceptions; - /** - * CP Service exception. Indicates the requested data being absent in a given dataspace + * Not found in dataspace exception. Indicates the requested data being absent in a given dataspace */ public class NotFoundInDataspaceException extends CpsException { - + private static final long serialVersionUID = 3838769447129047713L; public NotFoundInDataspaceException(final String dataspaceName, final String descriptionOfObject) { diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java index b3766726f0..9376d6893d 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java @@ -19,6 +19,9 @@ package org.onap.cps.spi.exceptions; +/** + * Schema set already defined exception. Indicates the a schema set with same name already exists in the same dataspace + */ public class SchemaSetAlreadyDefinedException extends CpsAdminException { private static final long serialVersionUID = 501929839139881112L; diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetNotFoundException.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetNotFoundException.java index f92ca37298..cf63f924fd 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetNotFoundException.java +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetNotFoundException.java @@ -19,6 +19,11 @@ package org.onap.cps.spi.exceptions; +/** + * Schema set not found exception. Indicates the schema set is not found in a given dataspace + */ + +@SuppressWarnings("squid:S110") // Team agreed to accept 6 levels of inheritance for CPS Exceptions public class SchemaSetNotFoundException extends CpsAdminException { private static final long serialVersionUID = 7422782395935450035L; @@ -33,4 +38,4 @@ public class SchemaSetNotFoundException extends CpsAdminException { super("Schema Set not found.", String.format("Schema Set with name %s was not found for dataspace %s.", schemaSetName, dataspaceName)); } -} \ No newline at end of file +} -- cgit 1.2.3-korg