cmHandles:
type: array
items:
- $ref: '#/components/schemas/cmHandle'
+ $ref: '#/components/schemas/dmiOperationCmHandle'
required:
- operation
- operationId
- datastore
- cmHandles
- cmHandle:
+ dmiOperationCmHandle:
type: object
- title: 'cmHandle'
+ title: 'CmHandle with properties for DMI'
properties:
id:
type: string
cmHandleProperties:
additionalProperties:
type: string
+ moduleSetTag:
+ type: string
+ example: module-set-tag1
example:
id: cmHandle123
cmHandleProperties:
myProp: some value
otherProp: other value
+ moduleSetTag: module-set-tag1
ModuleResourcesReadRequest:
type: object
@Override
public ResponseEntity<Void> getResourceDataForCmHandleDataOperation(final String topic, final String requestId,
final ResourceDataOperationRequests resourceDataOperationRequests) {
+ log.info("Request Details (for testing purposes)");
+ log.info("Request Id: {}", requestId);
+ log.info("Topic: {}", topic);
+
+ log.info("Details of the first Operation");
+ log.info("Resource Identifier: {}", resourceDataOperationRequests.get(0).getResourceIdentifier());
+ log.info("Module Set Tag: {}", resourceDataOperationRequests.get(0).getCmHandles().get(0).getModuleSetTag());
+ log.info("Operation Id: {}", resourceDataOperationRequests.get(0).getOperationId());
+ log.info("Cm Handles: {}", resourceDataOperationRequests.get(0).getCmHandles());
+ log.info("Options: {}", resourceDataOperationRequests.get(0).getOptions());
+
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
def resourceDataUrl = "$basePathV1/data?topic=client-topic-name&requestId=some-requestId"
and: 'list of operation details are received into request body'
def dataOperationRequestBody = '[{"operation": "read", "operationId": "14", "datastore": "ncmp-datastore:passthrough-operational", "options": "some options", "resourceIdentifier": "some resourceIdentifier",' +
- ' "cmhandles": [ {"id": "cmHanlde123", "cmHandleProperties": { "myProp`": "some value", "otherProp": "other value"}}]}]'
+ '"cmHandles": [ {"id": "cmHandle123", "moduleSetTag": "module-set-tag1", "cmHandleProperties": { "myProp`": "some value", "otherProp": "other value"}}]}]'
when: 'the dmi resource data for dataOperation api is called.'
def response = mvc.perform(
post(resourceDataUrl).contentType(MediaType.APPLICATION_JSON).content(dataOperationRequestBody)
).andReturn().response
then: 'the resource data operation endpoint returns the not implemented response'
assert response.status == 501
+ and: 'the job details are correctly received (logged)'
+ assert getLoggingMessage(1).contains('some-requestId')
+ assert getLoggingMessage(2).contains('client-topic-name')
+ assert getLoggingMessage(4).contains('some resourceIdentifier')
+ assert getLoggingMessage(5).contains('module-set-tag1')
+ and: 'the operation Id is correctly received (logged)'
+ assert getLoggingMessage(6).contains('14')
}
def getLoggingMessage(int index) {