Remove private properties from DMI write operations 62/140562/1
authorsourabh_sourabh <sourabh.sourabh@est.tech>
Mon, 24 Mar 2025 13:40:44 +0000 (13:40 +0000)
committersourabh_sourabh <sourabh.sourabh@est.tech>
Mon, 24 Mar 2025 16:40:13 +0000 (16:40 +0000)
Issue-ID: CPS-2693
Change-Id: Ibef6a3bed095bc668d07324bf7cf011fdb01da09
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/datajobs/models/DmiWriteOperation.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/datajobs/WriteRequestExaminer.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DmiSubJobRequestHandlerSpec.groovy

index 7e9ca79..2119f81 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation.
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,8 +20,6 @@
 
 package org.onap.cps.ncmp.api.datajobs.models;
 
-import java.util.Map;
-
 /**
  * Describes the write data job operation to be forwarded to dmi.
  *
@@ -32,12 +30,10 @@ import java.util.Map;
  * @param moduleSetTag       The module set tag of the CM Handle.
  * @param value              The value to be written depends on the type of operation.
  * @param operationId        Unique identifier of the operation within the request.
- * @param privateProperties  Contains the private properties of a Cm Handle.
  */
 public record DmiWriteOperation(
         String path,
         String op,
         String moduleSetTag,
         Object value,
-        String operationId,
-        Map<String, String> privateProperties) {}
+        String operationId) {}
index f200aa2..f189edc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 package org.onap.cps.ncmp.impl.datajobs;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -107,7 +106,6 @@ public class WriteRequestExaminer {
                 writeOperation.op(),
                 ncmpServiceCmHandle.getModuleSetTag(),
                 writeOperation.value(),
-                writeOperation.operationId(),
-                Collections.emptyMap()); // TODO: Private properties will be removed as part of CPS-2693.
+                writeOperation.operationId());
     }
 }
index 93362f2..175fb18 100644 (file)
@@ -25,13 +25,13 @@ class DmiSubJobRequestHandlerSpec extends Specification {
         given: 'a data job id, metadata and a map of producer keys and write operations to create a request'
             def dataJobId = 'some-job-id'
             def dataJobMetadata = new DataJobMetadata('d1', 't1', 't2')
-            def dmiWriteOperation = new DmiWriteOperation('p', 'operation', 'tag', null, 'o1', [:])
-            def dmiWriteOperationsPerProducerKey = [new ProducerKey('dmi1', 'prod1'): [dmiWriteOperation]]
+            def dmiWriteOperation = new DmiWriteOperation('p', 'operation', 'tag', null, 'o1')
+            def dmiWriteOperationsPerProducerKey = [(new ProducerKey('dmi1', 'prod1')): [dmiWriteOperation]]
             def authorization = 'my authorization header'
         and: 'the dmi rest client will return a response (for the correct parameters)'
             def responseAsKeyValuePairs = [subJobId:'my-sub-job-id']
             def responseEntity = new ResponseEntity<>(responseAsKeyValuePairs, HttpStatus.OK)
-            def expectedJson = '{"destination":"d1","dataAcceptType":"t1","dataContentType":"t2","dataProducerId":"prod1","dataJobId":"some-job-id","data":[{"path":"p","op":"operation","moduleSetTag":"tag","value":null,"operationId":"o1","privateProperties":{}}]}'
+            def expectedJson = '{"destination":"d1","dataAcceptType":"t1","dataContentType":"t2","dataProducerId":"prod1","dataJobId":"some-job-id","data":[{"path":"p","op":"operation","moduleSetTag":"tag","value":null,"operationId":"o1"}]}'
             mockDmiRestClient.synchronousPostOperationWithJsonData(RequiredDmiService.DATA, _, expectedJson, OperationType.CREATE, authorization) >> responseEntity
         when: 'sending request to DMI invoked'
             objectUnderTest.sendRequestsToDmi(authorization, dataJobId, dataJobMetadata, dmiWriteOperationsPerProducerKey)