aboutsummaryrefslogtreecommitdiffstats
path: root/models-errors
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-04-02 15:15:39 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-04-10 13:39:24 +0100
commit22afe401ca130eba6543f740039e8a3c13d11861 (patch)
treefd15c592ed84dd364757ccecd67438a9d2fe58b4 /models-errors
parent389c85c8e7213c10c17896f4c63d94e2b5e9d27a (diff)
Dependency management update
- including dependencies to pom.xml files only where they are used, avoiding extra dependencies being added in all packages. Issue-ID: POLICY-4945 Change-Id: I85b18befe3fe2877c754b1ac818d1b4994f9f7f9 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'models-errors')
-rw-r--r--models-errors/pom.xml36
-rw-r--r--models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java10
2 files changed, 39 insertions, 7 deletions
diff --git a/models-errors/pom.xml b/models-errors/pom.xml
index 96f417e4a..33ef027dd 100644
--- a/models-errors/pom.xml
+++ b/models-errors/pom.xml
@@ -1,6 +1,6 @@
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019, 2023 Nordix Foundation.
+ Copyright (C) 2019, 2023-2024 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,9 +34,41 @@
<description>The models for Policy API's to return Error/warning message details.</description>
<dependencies>
<dependency>
- <groupId>org.onap.policy.common</groupId>
+ <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
<version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
diff --git a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
index 749651310..e571e4058 100644
--- a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
+++ b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,14 +42,14 @@ public final class ErrorResponseUtils {
public static void getExceptionMessages(final ErrorResponse errorResponse, final Throwable throwable) {
errorResponse.setErrorMessage(throwable.getMessage());
- List<String> cascascadedErrorMessages = new ArrayList<>();
+ List<String> cascadedErrorMessages = new ArrayList<>();
for (var t = throwable; t != null; t = t.getCause()) {
- cascascadedErrorMessages.add(t.getMessage());
+ cascadedErrorMessages.add(t.getMessage());
}
- if (!cascascadedErrorMessages.isEmpty()) {
- errorResponse.setErrorDetails(cascascadedErrorMessages);
+ if (!cascadedErrorMessages.isEmpty()) {
+ errorResponse.setErrorDetails(cascadedErrorMessages);
}
}
}