summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/java
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2023-06-13 10:56:29 +0000
committerGerrit Code Review <gerrit@onap.org>2023-06-13 10:56:29 +0000
commit1368fd006373dd209a34274723fbda6ecb9d317f (patch)
tree2c107e74553417f73fd67799705b26da8eb05288 /cps-ri/src/main/java
parent7bf37672c41c84182063e6a25cb3ca4306dd142f (diff)
parent240ac3d9cd8107250574dd0f7221ae2f1afa3bd7 (diff)
Merge "Move integration test (DataService)"
Diffstat (limited to 'cps-ri/src/main/java')
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java3
-rwxr-xr-xcps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java6
2 files changed, 4 insertions, 5 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
index fdb01485ad..02f723029d 100644
--- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
@@ -692,8 +692,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
private String mergeLeaves(final Map<String, Serializable> updateLeaves, final String currentLeavesAsString) {
Map<String, Serializable> currentLeavesAsMap = new HashMap<>();
if (currentLeavesAsString != null) {
- currentLeavesAsMap = currentLeavesAsString.isEmpty()
- ? new HashMap<>() : jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class);
+ currentLeavesAsMap = jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class);
currentLeavesAsMap.putAll(updateLeaves);
}
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
index e149a1f149..136512077c 100755
--- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
@@ -340,15 +340,15 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ
if (optionalFileName.isPresent()) {
return optionalFileName.get();
}
- return null;
+ return "no filename";
}
private String getDuplicatedChecksumFromException(final ConstraintViolationException exception) {
final Matcher matcher = CHECKSUM_EXCEPTION_PATTERN.matcher(exception.getSQLException().getMessage());
- if (matcher.find() && matcher.groupCount() == 1) {
+ if (matcher.find()) {
return matcher.group(1);
}
- return null;
+ return "no checksum found";
}
private static ModuleReference toModuleReference(