aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/java
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2023-05-23 09:30:37 +0100
committerToineSiebelink <toine.siebelink@est.tech>2023-06-12 14:59:38 +0100
commit240ac3d9cd8107250574dd0f7221ae2f1afa3bd7 (patch)
tree1677ef197e3b785a79d12418c9554b9f25ad4975 /cps-ri/src/main/java
parentb3b44d9aa4e71c4264df140ffff27b5ba4c44e82 (diff)
Move integration test (DataService)
- Moved all Data Intergation Test - Added/improved some module Moudle Servcie test too - Removed some unused (impossible) code-paths in prod code - Replaced null's with meaningful strings (in edge case scenarios) - Replaced @Shared with static (shorter) in some test Issue-ID: CPS-1687 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ib4b1ec1706ace7e3f5ac03d85177a6f7d4f6b8d0
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 fdb01485a..02f723029 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 e149a1f14..136512077 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(