diff options
author | 2019-07-22 13:09:18 -0400 | |
---|---|---|
committer | 2019-07-23 15:31:17 -0400 | |
commit | 9c0f6c2b556c9d39766636544827189d75b6af50 (patch) | |
tree | 1022153a904cb1ad680f770bf06affd619f6056b /ms/controllerblueprints/modules/blueprint-core/src/test | |
parent | a0140dea9c608d745767574ac621ca0060a2bddc (diff) |
Clean restconf duplicate models and Implementation.
Change-Id: Id439ac5ded631aac0ee7fc69846ebe9bca650bb2
Issue-ID: CCSDK-1499
Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test')
2 files changed, 44 insertions, 1 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintIOUtilsTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintIOUtilsTest.kt new file mode 100644 index 000000000..2aea4bc2d --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintIOUtilsTest.kt @@ -0,0 +1,42 @@ +/* + * Copyright © 2019 IBM. + * + * 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. + */ + +package org.onap.ccsdk.cds.controllerblueprints.core.utils + +import kotlinx.coroutines.runBlocking +import org.junit.Test +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException + + +class BluePrintIOUtilsTest { + + @Test + fun testRetry() { + runBlocking { + val executionBlock: suspend (Int) -> String = { count: Int -> + "success" + } + val exceptionBlock = { e: Exception -> + if (e is BluePrintRetryException) { + println("this is blueprint error") + } else { + throw e + } + } + BluePrintIOUtils.retry<String>(4, 0, 500, executionBlock, exceptionBlock) + } + } +}
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JsonParserUtilsTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JsonParserUtilsTest.kt index 810dae738..8a37a4b19 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JsonParserUtilsTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JsonParserUtilsTest.kt @@ -22,6 +22,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType import org.onap.ccsdk.cds.controllerblueprints.core.jsonPathParse import org.onap.ccsdk.cds.controllerblueprints.core.jsonPaths import kotlin.test.assertEquals +import kotlin.test.assertNotNull class JsonParserUtilsTest { @@ -52,6 +53,6 @@ class JsonParserUtilsTest { """.trimIndent() val jsonNode = json.jsonAsJsonType() val parsedPath = jsonNode.jsonPaths("$..prop1") - println(parsedPath) + assertNotNull(parsedPath, "failed to get parsed path") } }
\ No newline at end of file |