diff --git a/components/model-catalog/blueprint-model/uat-blueprints/README.md b/components/model-catalog/blueprint-model/uat-blueprints/README.md
index d6a3352..56cb329 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/README.md
+++ b/components/model-catalog/blueprint-model/uat-blueprints/README.md
@@ -7,7 +7,7 @@
 
 - It uses an embedded, in-memory, and initially empty H2 database, running in MySQL/MariaDB compatibility mode;
 - All external services are mocked.
-  
+
 ## How it works?
 
 The UATs are declarative, data-driven tests implemented in YAML 1.1 documents.
@@ -33,6 +33,62 @@
 
 ## `uat.yaml` reference
 
+The structure of an UAT YAML file could be documented using the Protobuf language as follows:
+
+```proto
+message Uat {
+    message Path {}
+    message Json {}
+
+    message Process {
+        required string name = 1;
+        required Json request = 2;
+        required Json expectedResponse = 3;
+        optional Json responseNormalizerSpec = 4;
+    }
+
+    message Request {
+        required string method = 1;
+        required Path path = 2;
+        optional string contentType = 3 [default = None];
+        optional Json body = 4;
+    }
+
+    message Response {
+        optional int32 status = 1 [default = 200];
+        optional Json body = 2;
+    }
+
+    message Expectation {
+        required Request request = 1;
+        required Response response = 2;
+    }
+
+    message ExternalService {
+        required string selector = 1;
+        repeated Expectation expectations = 2;      // min cardinality = 1
+    }
+
+    repeated Process processes = 1;                 // min cardinality = 1
+    repeated ExternalService externalServices = 2;  // min cardinality = 0
+}
+
+```
+
+The optional `responseNormalizerSpec` specifies transformations that may be needed to apply to the response
+returned by BPP to get a full JSON representation. For example, it's possible to convert an string field "outer.inner"
+into JSON using the following specification:
+
+```yaml
+    responseNormalizerSpec:
+      outer:
+        inner: ?from-json(.outer.inner)
+
+```
+
+The "?" must prefix every expression that is NOT a literal string. The `from-json()` function and
+many others are documented [here](https://github.com/schibsted/jslt/blob/0.1.8/functions.md).
+
 ### Skeleton of a basic `uat.yaml`
 
 ```yaml
@@ -93,16 +149,16 @@
 
 ### Composite URI paths
 
-In case your YAML document contains many URI path definitions, you'd better keep the duplications
+In case your YAML document contains many URI path definitions, it's recommended to keep the duplications
 as low as possible in order to ease the document maintenance, and avoid inconsistencies.
- 
+
 Since YAML doesn't provide a standard mechanism to concatenate strings,
 the UAT engine implements an ad-hoc mechanism based on multi-level lists.
 Please note that currently this mechanism is only applied to URI paths.
 
 To exemplify how it works, let's take the case of eliminating duplications when defining multiple OpenDaylight URLs.
 
-You might starting using the following definitions:
+You might start using the following definitions:
 ```yaml
    nodeId: &nodeId "new-netconf-device"
    # ...
@@ -127,7 +183,7 @@
    # ...
    - request:
      path: restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/yang-ext:mount/mynetconf:netconflist
-``` 
+```
 
 ## License
 
@@ -135,9 +191,7 @@
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
+You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
index 37029e1..789659e 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
@@ -52,6 +52,11 @@
                     target: /
                     value: { netconflist: { netconf: [ { netconf-id: "30", netconf-param: "3000" }]}}
           status: success
+    responseNormalizerSpec:
+      stepData:
+        properties:
+          resource-assignment-params:
+            config-assign: ?from-json(.stepData.properties.resource-assignment-params.config-assign)
   - name: config-deploy
     request:
       commonHeader: *commonHeader
diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml
index 314b09c..120b948 100755
--- a/ms/blueprintsprocessor/application/pom.xml
+++ b/ms/blueprintsprocessor/application/pom.xml
@@ -132,6 +132,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>com.schibsted.spt.data</groupId>
+            <artifactId>jslt</artifactId>
+            <version>0.1.8</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
         </dependency>
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTests.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTest.kt
similarity index 63%
rename from ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTests.kt
rename to ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTest.kt
index 0a57277..ad4173c 100644
--- a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTests.kt
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintsAcceptanceTest.kt
@@ -19,7 +19,9 @@
  */
 package org.onap.ccsdk.cds.blueprintsprocessor
 
+import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.node.MissingNode
 import com.nhaarman.mockitokotlin2.any
 import com.nhaarman.mockitokotlin2.argThat
 import com.nhaarman.mockitokotlin2.atLeast
@@ -53,15 +55,17 @@
 import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.rules.SpringClassRule
 import org.springframework.test.context.junit4.rules.SpringMethodRule
+import org.springframework.test.web.reactive.server.EntityExchangeResult
 import org.springframework.test.web.reactive.server.WebTestClient
-import org.yaml.snakeyaml.Yaml
 import reactor.core.publisher.Mono
 import java.io.File
-import java.nio.file.Path
+import java.nio.charset.StandardCharsets
 import java.nio.file.Paths
 import kotlin.test.BeforeTest
 import kotlin.test.Test
 
+// Only one runner can be configured with jUnit 4. We had to replace the SpringRunner by equivalent jUnit rules.
+// See more on https://docs.spring.io/autorepo/docs/spring-framework/current/spring-framework-reference/testing.html#testcontext-junit4-rules
 @RunWith(Parameterized::class)
 // Set blueprintsprocessor.httpPort=0 to trigger a random port selection
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@@ -71,8 +75,7 @@
     TestSecuritySettings.ServerContextInitializer::class
 ])
 @TestPropertySource(locations = ["classpath:application-test.properties"])
-@Suppress("UNCHECKED_CAST")
-class BlueprintsAcceptanceTests(private val blueprintName: String, private val filename: String) {
+class BlueprintsAcceptanceTest(private val blueprintName: String, private val filename: String) {
 
     companion object {
         const val UAT_BLUEPRINTS_BASE_DIR = "../../../components/model-catalog/blueprint-model/uat-blueprints"
@@ -82,11 +85,15 @@
         @JvmField
         val springClassRule = SpringClassRule()
 
-        val log: Logger = LoggerFactory.getLogger(BlueprintsAcceptanceTests::class.java)
+        val log: Logger = LoggerFactory.getLogger(BlueprintsAcceptanceTest::class.java)
 
+        /**
+         * Generates the parameters to create a test instance for every blueprint found under UAT_BLUEPRINTS_BASE_DIR
+         * that contains the proper UAT definition file.
+         */
         @Parameterized.Parameters(name = "{index} {0}")
         @JvmStatic
-        fun filenames(): List<Array<String>> {
+        fun testParameters(): List<Array<String>> {
             return File(UAT_BLUEPRINTS_BASE_DIR)
                     .listFiles { file -> file.isDirectory && File(file, EMBEDDED_UAT_FILE).isFile }
                     ?.map { file -> arrayOf(file.nameWithoutExtension, file.canonicalPath) }
@@ -119,38 +126,31 @@
 
     @Test
     fun testBlueprint() {
-        val yaml: Map<String, *> = loadYaml(Paths.get(filename, EMBEDDED_UAT_FILE))
+        val uat = UatDefinition.load(mapper, Paths.get(filename, EMBEDDED_UAT_FILE))
 
         uploadBlueprint(blueprintName)
 
         // Configure mocked external services
-        val services = yaml["external-services"] as List<Map<String, *>>? ?: emptyList()
-        val expectationPerClient = services.map { service ->
-            val selector = service["selector"] as String
-            val expectations = (service["expectations"] as List<Map<String, *>>).map {
-                parseExpectation(it)
-            }
-            val mockClient = createRestClientMock(selector, expectations)
-            mockClient to expectations
-        }.toMap()
+        val expectationPerClient = uat.externalServices.associateBy(
+                { service -> createRestClientMock(service.selector, service.expectations) },
+                { service -> service.expectations }
+        )
 
         // Run processes
-        for (process in (yaml["processes"] as List<Map<String, *>>)) {
-            val processName = process["name"]
-            log.info("Executing process '$processName'")
-            val request = mapper.writeValueAsString(process["request"])
-            val expectedResponse = mapper.writeValueAsString(process["expectedResponse"])
-            processBlueprint(request, expectedResponse)
+        for (process in uat.processes) {
+            log.info("Executing process '${process.name}'")
+            processBlueprint(process.request, process.expectedResponse,
+                    JsonNormalizer.getNormalizer(mapper, process.responseNormalizerSpec))
         }
 
-        // Validate request payloads
+        // Validate request payloads to external services
         for ((mockClient, expectations) in expectationPerClient) {
             expectations.forEach { expectation ->
                 verify(mockClient, atLeastOnce()).exchangeResource(
-                        eq(expectation.method),
-                        eq(expectation.path),
-                        argThat { assertJsonEqual(expectation.expectedRequestBody, this) },
-                        expectation.requestHeadersMatcher())
+                        eq(expectation.request.method),
+                        eq(expectation.request.path),
+                        argThat { assertJsonEqual(expectation.request.body, this) },
+                        expectation.request.requestHeadersMatcher())
             }
             // Don't mind the invocations to the overloaded exchangeResource(String, String, String)
             verify(mockClient, atLeast(0)).exchangeResource(any(), any(), any())
@@ -158,7 +158,8 @@
         }
     }
 
-    private fun createRestClientMock(selector: String, restExpectations: List<RestExpectation>): BlueprintWebClientService {
+    private fun createRestClientMock(selector: String, restExpectations: List<ExpectationDefinition>)
+            : BlueprintWebClientService {
         val restClient = mock<BlueprintWebClientService>(verboseLogging = true)
 
         // Delegates to overloaded exchangeResource(String, String, String, Map<String, String>)
@@ -171,11 +172,11 @@
                 }
         for (expectation in restExpectations) {
             whenever(restClient.exchangeResource(
-                    eq(expectation.method),
-                    eq(expectation.path),
+                    eq(expectation.request.method),
+                    eq(expectation.request.path),
                     any(),
                     any()))
-                    .thenReturn(WebClientResponse(expectation.statusCode, expectation.responseBody))
+                    .thenReturn(WebClientResponse(expectation.response.status, expectation.response.body.toString()))
         }
 
         whenever(restClientFactory.blueprintWebClientService(selector))
@@ -194,17 +195,20 @@
                 .expectStatus().isOk
     }
 
-    private fun processBlueprint(request: String, expectedResponse: String) {
+    private fun processBlueprint(request: JsonNode, expectedResponse: JsonNode,
+                                 responseNormalizer: (String) -> String) {
         webTestClient
                 .post()
                 .uri("/api/v1/execution-service/process")
                 .header("Authorization", TestSecuritySettings.clientAuthToken())
                 .contentType(MediaType.APPLICATION_JSON_UTF8)
-                .body(Mono.just(request), String::class.java)
+                .body(Mono.just(request.toString()), String::class.java)
                 .exchange()
                 .expectStatus().isOk
                 .expectBody()
-                .json(expectedResponse)
+                .consumeWith { response ->
+                    assertJsonEqual(expectedResponse, responseNormalizer(getBodyAsString(response)))
+                }
     }
 
     private fun getBlueprintAsResource(blueprintName: String): Resource {
@@ -216,65 +220,21 @@
         }
     }
 
-    private fun loadYaml(path: Path): Map<String, Any> {
-        return path.toFile().reader().use { reader ->
-            Yaml().load(reader)
+    private fun assertJsonEqual(expected: JsonNode, actual: String): Boolean {
+        if ((actual == "") && (expected is MissingNode)) {
+            return true
         }
-    }
-
-    private fun assertJsonEqual(expected: Any, actual: String): Boolean {
-        if (actual != expected) {
-            // assertEquals throws an exception whenever match fails
-            JSONAssert.assertEquals(mapper.writeValueAsString(expected), actual, JSONCompareMode.LENIENT)
-        }
+        JSONAssert.assertEquals(expected.toString(), actual, JSONCompareMode.LENIENT)
+        // assertEquals throws an exception whenever match fails
         return true
     }
 
-    private fun parseExpectation(expectation: Map<String, *>): RestExpectation {
-        val request = expectation["request"] as Map<String, Any>
-        val method = request["method"] as String
-        val path = joinPath(request.getValue("path"))
-        val contentType = request["content-type"] as String?
-        val requestBody = request.getOrDefault("body", "")
-
-        val response = expectation["response"] as Map<String, Any>? ?: emptyMap()
-        val status = response["status"] as Int? ?: 200
-        val responseBody = when (val body = response["body"] ?: "") {
-            is String -> body
-            else -> mapper.writeValueAsString(body)
+    private fun getBodyAsString(result: EntityExchangeResult<ByteArray>): String {
+        val body = result.responseBody
+        if ((body == null) || body.isEmpty()) {
+            return ""
         }
-
-        return RestExpectation(method, path, contentType, requestBody, status, responseBody)
-    }
-
-    /**
-     * Join a multilevel lists of strings.
-     * Example: joinPath(listOf("a", listOf("b", "c"), "d")) will result in "a/b/c/d".
-     */
-    private fun joinPath(any: Any): String {
-        fun recursiveJoin(any: Any, sb: StringBuilder): StringBuilder {
-            when (any) {
-                is List<*> -> any.filterNotNull().forEach { recursiveJoin(it, sb) }
-                is String -> {
-                    if (sb.isNotEmpty()) {
-                        sb.append('/')
-                    }
-                    sb.append(any)
-                }
-                else -> throw IllegalArgumentException("Unsupported type: ${any.javaClass}")
-            }
-            return sb
-        }
-
-        return recursiveJoin(any, StringBuilder()).toString()
-    }
-
-    data class RestExpectation(val method: String, val path: String, val contentType: String?,
-                               val expectedRequestBody: Any,
-                               val statusCode: Int, val responseBody: String) {
-
-        fun requestHeadersMatcher(): Map<String, String> {
-            return if (contentType != null) eq(mapOf("Content-Type" to contentType)) else any()
-        }
+        val charset = result.responseHeaders.contentType?.charset ?: StandardCharsets.UTF_8
+        return String(body, charset)
     }
 }
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt
index 4576f27..3c517e6 100644
--- a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt
@@ -1,3 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.ccsdk.cds.blueprintsprocessor
 
 import org.junit.rules.TemporaryFolder
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/JsonNormalizer.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/JsonNormalizer.kt
new file mode 100644
index 0000000..69673f9
--- /dev/null
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/JsonNormalizer.kt
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.ccsdk.cds.blueprintsprocessor
+
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.node.ContainerNode
+import com.fasterxml.jackson.databind.node.MissingNode
+import com.fasterxml.jackson.databind.node.ObjectNode
+import com.schibsted.spt.data.jslt.Parser
+
+class JsonNormalizer {
+
+    companion object {
+
+        fun getNormalizer(mapper: ObjectMapper, jsltSpec: JsonNode): (String) -> String {
+            if (jsltSpec is MissingNode) {
+                return { it }
+            }
+            return { s: String ->
+                val input = mapper.readTree(s)
+                val expandedJstlSpec = expandJstlSpec(jsltSpec)
+                val jslt = Parser.compileString(expandedJstlSpec)
+                val output = jslt.apply(input)
+                output.toString()
+            }
+        }
+
+        /**
+         * Creates an extended JSTL spec by appending the "*: ." wildcard pattern to every inner JSON object, and
+         * removing the extra quotes added by the standard YAML/JSON converters on fields prefixed by "?".
+         *
+         * @param jstlSpec the JSTL spec as a structured JSON object.
+         * @return the string representation of the extended JSTL spec.
+         */
+        private fun expandJstlSpec(jstlSpec: JsonNode): String {
+            val extendedJstlSpec = updateObjectNodes(jstlSpec, "*", ".")
+            return extendedJstlSpec.toString()
+                    // Handle the "?" as a prefix to literal/non-quoted values
+                    .replace("\"\\?([^\"]+)\"".toRegex(), "$1")
+                    // Also, remove the quotes added by Jackson for key and value of the wildcard matcher
+                    .replace("\"([.*])\"".toRegex(), "$1")
+        }
+
+        /**
+         * Expands a structured JSON object, by adding the given key and value to every nested ObjectNode.
+         *
+         * @param jsonNode the root node.
+         * @param fieldName the fixed field name.
+         * @param fieldValue the fixed field value.
+         */
+        private fun updateObjectNodes(jsonNode: JsonNode, fieldName: String, fieldValue: String): JsonNode {
+            if (jsonNode is ContainerNode<*>) {
+                (jsonNode as? ObjectNode)?.put(fieldName, fieldValue)
+                jsonNode.forEach { child ->
+                    updateObjectNodes(child, fieldName, fieldValue)
+                }
+            }
+            return jsonNode
+        }
+    }
+}
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/PathDeserializer.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/PathDeserializer.kt
new file mode 100644
index 0000000..1a232f2
--- /dev/null
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/PathDeserializer.kt
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.ccsdk.cds.blueprintsprocessor
+
+import com.fasterxml.jackson.core.JsonParser
+import com.fasterxml.jackson.databind.DeserializationContext
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer
+
+class PathDeserializer : StdDeserializer<String>(String::class.java) {
+    override fun deserialize(jp: JsonParser, ctxt: DeserializationContext?): String {
+        val path = jp.codec.readValue(jp, Any::class.java)
+        return flatJoin(path)
+    }
+
+    /**
+     * Join a multilevel lists of strings.
+     * Example: flatJoin(listOf("a", listOf("b", "c"), "d")) will result in "a/b/c/d".
+     */
+    private fun flatJoin(path: Any): String {
+        fun flatJoinTo(sb: StringBuilder, path: Any): StringBuilder {
+            when (path) {
+                is List<*> -> path.filterNotNull().forEach { flatJoinTo(sb, it) }
+                is String -> {
+                    if (sb.isNotEmpty()) {
+                        sb.append('/')
+                    }
+                    sb.append(path)
+                }
+                else -> throw IllegalArgumentException("Unsupported type: ${path.javaClass}")
+            }
+            return sb
+        }
+        return flatJoinTo(StringBuilder(), path).toString()
+    }
+}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/UatDefinition.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/UatDefinition.kt
new file mode 100644
index 0000000..ce20611
--- /dev/null
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/UatDefinition.kt
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.ccsdk.cds.blueprintsprocessor
+
+import com.fasterxml.jackson.annotation.JsonAlias
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.node.MissingNode
+import com.nhaarman.mockitokotlin2.any
+import com.nhaarman.mockitokotlin2.eq
+import org.yaml.snakeyaml.Yaml
+import java.nio.file.Path
+
+data class ProcessDefinition(val name: String, val request: JsonNode, val expectedResponse: JsonNode,
+                             val responseNormalizerSpec: JsonNode = MissingNode.getInstance())
+
+data class RequestDefinition(val method: String,
+                             @JsonDeserialize(using = PathDeserializer::class)
+                             val path: String,
+                             @JsonAlias("content-type")
+                             val contentType: String? = null,
+                             val body: JsonNode = MissingNode.getInstance()) {
+    fun requestHeadersMatcher(): Map<String, String> {
+        return if (contentType != null) eq(mapOf("Content-Type" to contentType)) else any()
+    }
+}
+
+data class ResponseDefinition(val status: Int = 200, val body: JsonNode = MissingNode.getInstance()) {
+    companion object {
+        val DEFAULT_RESPONSE = ResponseDefinition()
+    }
+}
+
+data class ExpectationDefinition(val request: RequestDefinition,
+                                 val response: ResponseDefinition = ResponseDefinition.DEFAULT_RESPONSE)
+
+data class ServiceDefinition(val selector: String, val expectations: List<ExpectationDefinition>)
+
+data class UatDefinition(val processes: List<ProcessDefinition>,
+                         @JsonAlias("external-services")
+                         val externalServices: List<ServiceDefinition> = emptyList()) {
+
+    companion object {
+        fun load(mapper: ObjectMapper, path: Path): UatDefinition {
+            return path.toFile().reader().use { reader ->
+                mapper.convertValue(Yaml().load(reader), UatDefinition::class.java)
+            }
+        }
+    }
+}
