Move integration test (DataService)
[cps.git] / cps-ri / src / main / java / org / onap / cps / spi / impl / CpsDataPersistenceServiceImpl.java
index d0154e1..02f7230 100644 (file)
@@ -218,7 +218,6 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
 
     private FragmentEntity toFragmentEntity(final AnchorEntity anchorEntity, final DataNode dataNode) {
         return FragmentEntity.builder()
-                .dataspace(anchorEntity.getDataspace())
                 .anchor(anchorEntity)
                 .xpath(dataNode.getXpath())
                 .attributes(jsonObjectMapper.asJsonString(dataNode.getLeaves()))
@@ -347,10 +346,10 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
             fragmentRepository.findExtractsWithDescendantsByIds(fragmentEntityIds, fetchDescendantsOption.getDepth());
 
         if (anchorEntity == ALL_ANCHORS) {
-            final Collection<Integer> anchorIds = fragmentExtracts.stream()
+            final Collection<Long> anchorIds = fragmentExtracts.stream()
                 .map(FragmentExtract::getAnchorId).collect(Collectors.toSet());
             final List<AnchorEntity> anchorEntities = anchorRepository.findAllById(anchorIds);
-            final Map<Integer, AnchorEntity> anchorEntityPerId = anchorEntities.stream()
+            final Map<Long, AnchorEntity> anchorEntityPerId = anchorEntities.stream()
                 .collect(Collectors.toMap(AnchorEntity::getId, Function.identity()));
             return FragmentEntityArranger.toFragmentEntityTreesAcrossAnchors(anchorEntityPerId, fragmentExtracts);
         }
@@ -693,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);
         }