aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-dcae/src/test
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2021-06-20 19:39:39 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-20 19:39:39 +0000
commitf00ca4de37bbbf272e107dd89f4dbb901c787462 (patch)
tree419f19cfffa1a49e5a4be4b80d75cfc740c26cf0 /participant/participant-impl/participant-impl-dcae/src/test
parent18526e9a01fc0b0e085d2a6e3457957e6392ce27 (diff)
parent2d186df9e3ed47599dbc86c2f435f7884535398c (diff)
Merge "Clean up CLAMP Sonar and checkstyle issues"
Diffstat (limited to 'participant/participant-impl/participant-impl-dcae/src/test')
-rw-r--r--participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/parameters/CommonTestData.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/parameters/CommonTestData.java
index cb06fcb15..5d8881eb3 100644
--- a/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/parameters/CommonTestData.java
+++ b/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/parameters/CommonTestData.java
@@ -59,16 +59,19 @@ public class CommonTestData {
/**
* Converts the contents of a map to a parameter class.
*
+ * @param <T> specific type of ParameterGroup class
* @param source property map
* @param clazz class of object to be created from the map
* @return a new object represented by the map
+ * @throws ControlLoopRuntimeException on errors
*/
public <T extends ParameterGroup> T toObject(final Map<String, Object> source, final Class<T> clazz) {
try {
return coder.convert(source, clazz);
} catch (final CoderException e) {
- throw new RuntimeException("cannot create " + clazz.getName() + " from map", e);
+ throw new ControlLoopRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
+ "cannot create " + clazz.getName() + " from map", e);
}
}
@@ -95,6 +98,7 @@ public class CommonTestData {
*
* @param isEmpty boolean value to represent that object created should be empty or not
* @return a property map suitable for constructing an object
+ * @throws ControlLoopRuntimeException on errors
*/
public Map<String, Object> getClampClientParametersMap(final boolean isEmpty) {
final Map<String, Object> map = new TreeMap<>();
@@ -121,6 +125,7 @@ public class CommonTestData {
*
* @param isEmpty boolean value to represent that object created should be empty or not
* @return a property map suitable for constructing an object
+ * @throws ControlLoopRuntimeException on errors
*/
public Map<String, Object> getConsulClientParametersMap(final boolean isEmpty) {
final Map<String, Object> map = new TreeMap<>();
@@ -228,6 +233,7 @@ public class CommonTestData {
*
* @param port port to be inserted into the parameters
* @return the standard participant parameters
+ * @throws ControlLoopRuntimeException on errors
*/
public ParticipantDcaeParameters getParticipantParameterGroup(int port) {
try {
@@ -244,6 +250,7 @@ public class CommonTestData {
*
* @param port port to be inserted into the parameters
* @return the standard participant parameters
+ * @throws ControlLoopRuntimeException on errors
*/
public static String getParticipantParameterGroupAsString(int port) {
@@ -289,6 +296,7 @@ public class CommonTestData {
*
* @param status the status of Partecipant
* @return the JSON
+ * @throws ControlLoopRuntimeException on errors
*/
public static String createJsonStatus(String status) {
try {