/*
* ============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.
package org.onap.cps.ncmp.api.datajobs.models;
-import java.util.Map;
-
/**
* Describes the write data job operation to be forwarded to dmi.
*
* @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) {}
/*
* ============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.
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;
writeOperation.op(),
ncmpServiceCmHandle.getModuleSetTag(),
writeOperation.value(),
- writeOperation.operationId(),
- Collections.emptyMap()); // TODO: Private properties will be removed as part of CPS-2693.
+ writeOperation.operationId());
}
}
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)