package org.onap.cps.ncmp.api.impl
-import org.onap.cps.ncmp.api.impl.client.DmiRestClient
-import org.onap.cps.ncmp.api.impl.operations.DmiRequestBody
-import org.springframework.http.HttpHeaders
-
import static org.onap.cps.ncmp.api.impl.operations.DmiOperations.DataStoreEnum.PASSTHROUGH_OPERATIONAL
import static org.onap.cps.ncmp.api.impl.operations.DmiOperations.DataStoreEnum.PASSTHROUGH_RUNNING
import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum.CREATE
import org.onap.cps.api.CpsQueryService
import org.onap.cps.ncmp.api.impl.exception.NcmpException
import org.onap.cps.ncmp.api.impl.operations.DmiDataOperations
-import org.onap.cps.ncmp.api.impl.operations.DmiModelOperations
import org.onap.cps.spi.FetchDescendantsOption
import org.onap.cps.spi.model.DataNode
import org.springframework.http.HttpStatus
1 * mockCpsDataService.saveListElements(expectedDataspaceName, cmHandle, xpath, jsonData, noTimestamp)
}
- def 'Write resource data for passthrough running from dmi using POST #scenario cm handle properties.'() {
+ def 'Write resource data for pass-through running from dmi using POST #scenario cm handle properties.'() {
given: 'a data node'
def dataNode = getDataNode(includeCmHandleProperties)
and: 'cpsDataService returns valid datanode'
'without' | false || '{}'
}
- def 'Write resource data for passthrough running from dmi using POST "not found" response (from DMI).'() {
+ def 'Write resource data for pass-through running from dmi using POST "not found" response (from DMI).'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'cpsDataService returns valid dataNode'
fetchDescendantsOption << FetchDescendantsOption.values()
}
- def 'Get resource data for passthrough operational from dmi.'() {
+ def 'Get resource data for pass-through operational from dmi.'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'get data node is called'
response == 'result-json'
}
- def 'Get resource data for passthrough operational from dmi with Json Processing Exception.'() {
+ def 'Get resource data for pass-through operational from dmi with Json Processing Exception.'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'cps data service returns valid data node'
exceptionThrown.details == 'DMI status code: 404, DMI response body: NOK-json'
}
- def 'Get resource data for passthrough operational from dmi return NOK response.'() {
+ def 'Get resource data for pass-through operational from dmi return NOK response.'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'cps data service returns valid data node'
exceptionThrown.details.contains('NOK-json')
}
- def 'Get resource data for passthrough running from dmi.'() {
+ def 'Get resource data for pass-through running from dmi.'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'cpsDataService returns valid data node'
response == '{result-json}'
}
- def 'Get resource data for passthrough running from dmi return NOK response.'() {
+ def 'Get resource data for pass-through running from dmi return NOK response.'() {
given: 'a data node'
def dataNode = getDataNode(true)
and: 'cpsDataService returns valid dataNode'
1 * mockCpsDataService.replaceNodeTree(expectedDataspaceName, cmHandle, xpath, jsonData, noTimestamp)
}
- def 'Update resource data for passthrough running from dmi using POST #scenario cm handle properties.'() {
+ def 'Update resource data for pass-through running from dmi using POST #scenario cm handle properties.'() {
given: 'a data node'
def dataNode = getDataNode(includeCmHandleProperties)
and: 'cpsDataService returns valid datanode'