summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service/src')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java5
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperation.java (renamed from cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java)6
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java48
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java32
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataOperationRequestUtils.java (renamed from cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java)49
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy2
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DataOperationRequestUtilsSpec.groovy2
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy6
8 files changed, 76 insertions, 74 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java
index e20780bf56..a65e3c4be1 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java
@@ -86,11 +86,10 @@ public interface NetworkCmProxyDataService {
* Execute (async) data operation for group of cm handles using dmi.
*
* @param topicParamInQuery topic name for (triggering) async responses
- * @param dataOperationRequest cm handle identifiers
+ * @param dataOperationRequest contains a list of operation definitions(multiple operations)
*/
void executeDataOperationForCmHandles(String topicParamInQuery,
- DataOperationRequest
- dataOperationRequest,
+ DataOperationRequest dataOperationRequest,
String requestId);
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperation.java
index 512c3bcda8..6346379b22 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperation.java
@@ -33,7 +33,7 @@ import org.onap.cps.ncmp.api.models.DataOperationDefinition;
@Getter
@Builder
@JsonPropertyOrder({"operation", "operationId", "datastore", "options", "resourceIdentifier", "cmHandles"})
-public class DmiBatchOperation {
+public class DmiDataOperation {
@JsonProperty("operation")
private OperationType operationType;
@@ -50,10 +50,10 @@ public class DmiBatchOperation {
* @param dataOperationDefinition definition of incoming of dataOperation request
* @return mapped dmi operation details
*/
- public static DmiBatchOperation buildDmiBatchRequestBodyWithoutCmHandles(
+ public static DmiDataOperation buildDmiDataOperationRequestBodyWithoutCmHandles(
final DataOperationDefinition dataOperationDefinition) {
- return DmiBatchOperation.builder()
+ return DmiDataOperation.builder()
.operationType(OperationType.fromOperationName(dataOperationDefinition.getOperation()))
.operationId(dataOperationDefinition.getOperationId())
.datastore(DatastoreType.fromDatastoreName(dataOperationDefinition.getDatastore()).getDatastoreName())
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java
index adf634da57..8596c56dca 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java
@@ -34,7 +34,7 @@ import org.onap.cps.ncmp.api.impl.client.DmiRestClient;
import org.onap.cps.ncmp.api.impl.config.NcmpConfiguration;
import org.onap.cps.ncmp.api.impl.executor.TaskExecutor;
import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder;
-import org.onap.cps.ncmp.api.impl.utils.ResourceDataBatchRequestUtils;
+import org.onap.cps.ncmp.api.impl.utils.ResourceDataOperationRequestUtils;
import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
import org.onap.cps.ncmp.api.inventory.CmHandleState;
import org.onap.cps.ncmp.api.inventory.InventoryPersistence;
@@ -131,11 +131,11 @@ public class DmiDataOperations extends DmiOperations {
final Collection<YangModelCmHandle> yangModelCmHandles
= getYangModelCmHandlesInReadyState(cmHandlesIds);
- final Map<String, List<DmiBatchOperation>> operationsOutPerDmiServiceName
- = ResourceDataBatchRequestUtils.processPerOperationInBatchRequest(dataOperationRequest,
+ final Map<String, List<DmiDataOperation>> operationsOutPerDmiServiceName
+ = ResourceDataOperationRequestUtils.processPerDefinitionInDataOperationsRequest(dataOperationRequest,
yangModelCmHandles);
- buildBatchRequestUrlAndSendToDmiService(topicParamInQuery, requestId, operationsOutPerDmiServiceName);
+ buildDataOperationRequestUrlAndSendToDmiService(topicParamInQuery, requestId, operationsOutPerDmiServiceName);
}
/**
@@ -196,13 +196,13 @@ public class DmiDataOperations extends DmiOperations {
cmHandleId));
}
- private String getDmiServiceBatchRequestUrl(final String dmiServiceName,
- final String topicParamInQuery,
- final String requestId) {
- final MultiValueMap<String, String> batchRequestQueryParams = dmiServiceUrlBuilder
- .getBatchRequestQueryParams(topicParamInQuery, requestId);
- return dmiServiceUrlBuilder.getBatchRequestUrl(batchRequestQueryParams,
- dmiServiceUrlBuilder.populateBatchUriVariables(dmiServiceName));
+ private String getDmiServiceDataOperationRequestUrl(final String dmiServiceName,
+ final String topicParamInQuery,
+ final String requestId) {
+ final MultiValueMap<String, String> dataOperationRequestQueryParams = dmiServiceUrlBuilder
+ .getDataOperationRequestQueryParams(topicParamInQuery, requestId);
+ return dmiServiceUrlBuilder.getDataOperationRequestUrl(dataOperationRequestQueryParams,
+ dmiServiceUrlBuilder.populateDataOperationRequestUriVariables(dmiServiceName));
}
private void validateIfCmHandleStateReady(final YangModelCmHandle yangModelCmHandle,
@@ -230,25 +230,27 @@ public class DmiDataOperations extends DmiOperations {
== CmHandleState.READY).collect(Collectors.toList());
}
- private void buildBatchRequestUrlAndSendToDmiService(final String topicParamInQuery,
- final String requestId,
- final Map<String, List<DmiBatchOperation>>
+ private void buildDataOperationRequestUrlAndSendToDmiService(final String topicParamInQuery,
+ final String requestId,
+ final Map<String, List<DmiDataOperation>>
groupsOutPerDmiServiceName) {
groupsOutPerDmiServiceName.entrySet().forEach(groupsOutPerDmiServiceNameEntry -> {
final String dmiServiceName = groupsOutPerDmiServiceNameEntry.getKey();
- final List<DmiBatchOperation> dmiBatchRequestBodies = groupsOutPerDmiServiceNameEntry.getValue();
- final String dmiBatchResourceDataUrl = getDmiServiceBatchRequestUrl(dmiServiceName, topicParamInQuery,
- requestId);
- sendBatchRequestToDmiService(dmiBatchResourceDataUrl, dmiBatchRequestBodies);
+ final List<DmiDataOperation> dmiDataOperationRequestBodies = groupsOutPerDmiServiceNameEntry.getValue();
+ final String dmiDataOperationResourceUrl =
+ getDmiServiceDataOperationRequestUrl(dmiServiceName, topicParamInQuery, requestId);
+ sendDataOperationRequestToDmiService(dmiDataOperationResourceUrl, dmiDataOperationRequestBodies);
});
}
- private void sendBatchRequestToDmiService(final String batchResourceDataUrl,
- final List<DmiBatchOperation> dmiBatchRequestBodies) {
- final String batchRequestBodiesAsJsonString = jsonObjectMapper.asJsonString(dmiBatchRequestBodies);
- TaskExecutor.executeTask(() -> dmiRestClient.postOperationWithJsonData(batchResourceDataUrl,
- batchRequestBodiesAsJsonString, READ), DEFAULT_ASYNC_TASK_EXECUTOR_TIMEOUT_IN_MILLISECONDS)
+ private void sendDataOperationRequestToDmiService(final String dataOperationResourceUrl,
+ final List<DmiDataOperation> dmiDataOperationRequestBodies) {
+ final String dataOperationRequestBodiesAsJsonString =
+ jsonObjectMapper.asJsonString(dmiDataOperationRequestBodies);
+ TaskExecutor.executeTask(() -> dmiRestClient.postOperationWithJsonData(dataOperationResourceUrl,
+ dataOperationRequestBodiesAsJsonString, READ),
+ DEFAULT_ASYNC_TASK_EXECUTOR_TIMEOUT_IN_MILLISECONDS)
.whenCompleteAsync(this::handleTaskCompletion);
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java
index 5c6fa9f0b0..d855442c53 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java
@@ -53,17 +53,17 @@ public class DmiServiceUrlBuilder {
}
/**
- * This method builds batch request url.
+ * This method builds data operation request url.
*
- * @param batchRequestQueryParams query param map as key, value pair
- * @param batchRequestUriVariables uri param map as key (placeholder), value pair
- * @return {@code String} batch request url as string
+ * @param dataoperationRequestQueryParams query param map as key, value pair
+ * @param dataoperationRequestUriVariables uri param map as key (placeholder), value pair
+ * @return {@code String} data operation request url as string
*/
- public String getBatchRequestUrl(final MultiValueMap<String, String> batchRequestQueryParams,
- final Map<String, Object> batchRequestUriVariables) {
- return getBatchResourceDataBasePathUriBuilder()
- .queryParams(batchRequestQueryParams)
- .uriVariables(batchRequestUriVariables)
+ public String getDataOperationRequestUrl(final MultiValueMap<String, String> dataoperationRequestQueryParams,
+ final Map<String, Object> dataoperationRequestUriVariables) {
+ return getDataOperationResourceDataBasePathUriBuilder()
+ .queryParams(dataoperationRequestQueryParams)
+ .uriVariables(dataoperationRequestUriVariables)
.buildAndExpand().toUriString();
}
@@ -82,11 +82,11 @@ public class DmiServiceUrlBuilder {
}
/**
- * This method creates the dmi service url builder object with path variables for batch of cm handles.
+ * This method creates the dmi service url builder object with path variables for data operation request.
*
* @return {@code UriComponentsBuilder} dmi service url builder object
*/
- public UriComponentsBuilder getBatchResourceDataBasePathUriBuilder() {
+ public UriComponentsBuilder getDataOperationResourceDataBasePathUriBuilder() {
return UriComponentsBuilder.newInstance()
.path("{dmiServiceName}")
.pathSegment("{dmiBasePath}")
@@ -116,12 +116,12 @@ public class DmiServiceUrlBuilder {
}
/**
- * This method populates uri variables for batch request.
+ * This method populates uri variables for data operation request.
*
* @param dmiServiceName dmi service name
* @return {@code Map<String, Object>} uri variables as map
*/
- public Map<String, Object> populateBatchUriVariables(final String dmiServiceName) {
+ public Map<String, Object> populateDataOperationRequestUriVariables(final String dmiServiceName) {
final Map<String, Object> uriVariables = new HashMap<>();
final String dmiBasePath = dmiProperties.getDmiBasePath();
uriVariables.put("dmiServiceName", dmiServiceName);
@@ -151,14 +151,14 @@ public class DmiServiceUrlBuilder {
}
/**
- * This method is used to populate map from query params for batch request.
+ * This method is used to populate map from query params for data operation request.
*
* @param topicParamInQuery topic into url param
* @param requestId unique id of response for valid topic
* @return all valid query params as map
*/
- public MultiValueMap<String, String> getBatchRequestQueryParams(final String topicParamInQuery,
- final String requestId) {
+ public MultiValueMap<String, String> getDataOperationRequestQueryParams(final String topicParamInQuery,
+ final String requestId) {
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
getQueryParamConsumer().accept("topic", topicParamInQuery, queryParams);
getQueryParamConsumer().accept("requestId", requestId, queryParams);
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataOperationRequestUtils.java
index f0d02552f6..573f8b39a9 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataOperationRequestUtils.java
@@ -31,26 +31,27 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.ncmp.api.impl.operations.CmHandle;
-import org.onap.cps.ncmp.api.impl.operations.DmiBatchOperation;
+import org.onap.cps.ncmp.api.impl.operations.DmiDataOperation;
import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
import org.onap.cps.ncmp.api.models.DataOperationDefinition;
import org.onap.cps.ncmp.api.models.DataOperationRequest;
@Slf4j
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class ResourceDataBatchRequestUtils {
+public class ResourceDataOperationRequestUtils {
private static final String UNKNOWN_SERVICE_NAME = null;
/**
- * Create a list of DMI batch operation per DMI service (name).
+ * Create a list of DMI data operations per DMI service (name).
*
* @param dataOperationRequestIn incoming data operation request details
* @param yangModelCmHandles involved cm handles represented as YangModelCmHandle (incl. metadata)
*
- * @return {@code Map<String, List<DmiBatchOperation>>} Create a list of DMI batch operation per DMI service (name).
+ * @return {@code Map<String, List<DmiDataOperation>>} Create a list of DMI data operations operation
+ * per DMI service (name).
*/
- public static Map<String, List<DmiBatchOperation>> processPerOperationInBatchRequest(
+ public static Map<String, List<DmiDataOperation>> processPerDefinitionInDataOperationsRequest(
final DataOperationRequest dataOperationRequestIn,
final Collection<YangModelCmHandle> yangModelCmHandles) {
@@ -60,7 +61,7 @@ public class ResourceDataBatchRequestUtils {
final Map<String, String> dmiServiceNamesPerCmHandleId =
getDmiServiceNamesPerCmHandleId(dmiPropertiesPerCmHandleIdPerServiceName);
- final Map<String, List<DmiBatchOperation>> dmiBatchOperationsOutPerDmiServiceName = new HashMap<>();
+ final Map<String, List<DmiDataOperation>> dmiDataOperationsOutPerDmiServiceName = new HashMap<>();
for (final DataOperationDefinition dataOperationDefinitionIn :
dataOperationRequestIn.getDataOperationDefinitions()) {
@@ -71,14 +72,14 @@ public class ResourceDataBatchRequestUtils {
if (cmHandleIdProperties == null) {
publishErrorMessageToClientTopic(cmHandleId);
} else {
- final DmiBatchOperation dmiBatchOperationOut = getOrAddDmiBatchOperation(dmiServiceName,
- dataOperationDefinitionIn, dmiBatchOperationsOutPerDmiServiceName);
+ final DmiDataOperation dmiDataOperationOut = getOrAddDmiDataOperation(dmiServiceName,
+ dataOperationDefinitionIn, dmiDataOperationsOutPerDmiServiceName);
final CmHandle cmHandle = CmHandle.buildCmHandleWithProperties(cmHandleId, cmHandleIdProperties);
- dmiBatchOperationOut.getCmHandles().add(cmHandle);
+ dmiDataOperationOut.getCmHandles().add(cmHandle);
}
}
}
- return dmiBatchOperationsOutPerDmiServiceName;
+ return dmiDataOperationsOutPerDmiServiceName;
}
private static void publishErrorMessageToClientTopic(final String requestedCmHandleId) {
@@ -103,24 +104,24 @@ public class ResourceDataBatchRequestUtils {
return dmiServiceNamesPerCmHandleId;
}
- private static DmiBatchOperation getOrAddDmiBatchOperation(final String dmiServiceName,
- final DataOperationDefinition
+ private static DmiDataOperation getOrAddDmiDataOperation(final String dmiServiceName,
+ final DataOperationDefinition
dataOperationDefinitionIn,
- final Map<String, List<DmiBatchOperation>>
- dmiBatchOperationsOutPerDmiServiceName) {
- dmiBatchOperationsOutPerDmiServiceName
+ final Map<String, List<DmiDataOperation>>
+ dmiDataOperationsOutPerDmiServiceName) {
+ dmiDataOperationsOutPerDmiServiceName
.computeIfAbsent(dmiServiceName, dmiServiceNameAsKey -> new ArrayList<>());
- final List<DmiBatchOperation> dmiBatchOperationsOut
- = dmiBatchOperationsOutPerDmiServiceName.get(dmiServiceName);
- final boolean isNewOperation = dmiBatchOperationsOut.isEmpty()
- || !dmiBatchOperationsOut.get(dmiBatchOperationsOut.size() - 1).getOperationId()
+ final List<DmiDataOperation> dmiDataOperationsOut
+ = dmiDataOperationsOutPerDmiServiceName.get(dmiServiceName);
+ final boolean isNewOperation = dmiDataOperationsOut.isEmpty()
+ || !dmiDataOperationsOut.get(dmiDataOperationsOut.size() - 1).getOperationId()
.equals(dataOperationDefinitionIn.getOperationId());
if (isNewOperation) {
- final DmiBatchOperation newDmiBatchOperationOut =
- DmiBatchOperation.buildDmiBatchRequestBodyWithoutCmHandles(dataOperationDefinitionIn);
- dmiBatchOperationsOut.add(newDmiBatchOperationOut);
- return newDmiBatchOperationOut;
+ final DmiDataOperation newDmiDataOperationOut =
+ DmiDataOperation.buildDmiDataOperationRequestBodyWithoutCmHandles(dataOperationDefinitionIn);
+ dmiDataOperationsOut.add(newDmiDataOperationOut);
+ return newDmiDataOperationOut;
}
- return dmiBatchOperationsOut.get(dmiBatchOperationsOut.size() - 1);
+ return dmiDataOperationsOut.get(dmiDataOperationsOut.size() - 1);
}
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy
index be178e1276..c7ee4e0745 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy
@@ -94,7 +94,7 @@ class DmiDataOperationsSpec extends DmiOperationsBaseSpec {
def expectedDmiBatchResourceDataUrl = "ncmp/v1/data/topic=my-topic-name"
def expectedBatchRequestAsJson = '[{"operation":"read","operationId":"operational-14","datastore":"ncmp-datastore:passthrough-operational","options":"some option","resourceIdentifier":"some resource identifier","cmHandles":[{"id":"some-cm-handle","cmHandleProperties":{"prop1":"val1"}}]}]'
mockDmiRestClient.postOperationWithJsonData(expectedDmiBatchResourceDataUrl, _, READ.operationName) >> responseFromDmi
- dmiServiceUrlBuilder.getBatchRequestUrl(_, _) >> expectedDmiBatchResourceDataUrl
+ dmiServiceUrlBuilder.getDataOperationRequestUrl(_, _) >> expectedDmiBatchResourceDataUrl
when: 'get resource data for group of cm handles are invoked'
objectUnderTest.requestResourceDataFromDmi('my-topic-name', dataOperationRequest, 'requestId')
then: 'wait a little to allow execution of service method by task executor (on separate thread)'
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DataOperationRequestUtilsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DataOperationRequestUtilsSpec.groovy
index af3841a40b..334b455ef7 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DataOperationRequestUtilsSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DataOperationRequestUtilsSpec.groovy
@@ -42,7 +42,7 @@ class DataOperationRequestUtilsSpec extends Specification {
and: '4 known cm handles: ch1-dmi1, ch2-dmi1, ch3-dmi2, ch4-dmi2'
def yangModelCmHandles = getYangModelCmHandles()
when: 'data operation request is processed'
- def operationsOutPerDmiServiceName = ResourceDataBatchRequestUtils.processPerOperationInBatchRequest(dataOperationRequest, yangModelCmHandles)
+ def operationsOutPerDmiServiceName = ResourceDataOperationRequestUtils.processPerDefinitionInDataOperationsRequest(dataOperationRequest, yangModelCmHandles)
and: 'converted to a json node'
def dmiDataOperationRequestBody = jsonObjectMapper.asJsonString(operationsOutPerDmiServiceName.get(serviceName))
def dmiDataOperationRequestBodyAsJsonNode = jsonObjectMapper.convertToJsonNode(dmiDataOperationRequestBody).get(operationIndex)
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy
index b1a8e85e2d..6c4575515f 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy
@@ -81,15 +81,15 @@ class DmiServiceUrlBuilderSpec extends Specification {
given: 'the required path parameters'
def batchRequestUriVariables = [dmiServiceName: 'some-service', dmiBasePath: 'testBase', cmHandleId: '123']
and: 'the relevant query parameters'
- def batchRequestQueryParams = objectUnderTest.getBatchRequestQueryParams('some topic', 'some id')
+ def batchRequestQueryParams = objectUnderTest.getDataOperationRequestQueryParams('some topic', 'some id')
when: 'a URL is created'
- def result = objectUnderTest.getBatchRequestUrl(batchRequestQueryParams, batchRequestUriVariables)
+ def result = objectUnderTest.getDataOperationRequestUrl(batchRequestQueryParams, batchRequestUriVariables)
then: 'it is formed correctly'
assert result.toString() == 'some-service/testBase/v1/data?topic=some topic&requestId=some id'
}
def 'Populate batch uri variables.'() {
expect: 'Populate batch uri variables returns a map with given service name and base path from setup'
- assert objectUnderTest.populateBatchUriVariables('some service') == [ dmiServiceName: 'some service',dmiBasePath: 'dmi' ]
+ assert objectUnderTest.populateDataOperationRequestUriVariables('some service') == [dmiServiceName: 'some service', dmiBasePath: 'dmi' ]
}
}