summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints/modules/service/src')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt2
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt14
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt2
3 files changed, 8 insertions, 10 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt
index cf1bfb578..41a7bf8a5 100644
--- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt
+++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt
@@ -103,7 +103,7 @@ class BluePrintEnhancerUtils {
suspend fun decompressFilePart(filePart: FilePart, archiveDir: String, enhanceDir: String): File {
val filePartFile = extractCompressFilePart(filePart, archiveDir, enhanceDir)
- val deCompressFileName = Paths.get(enhanceDir).toUri().path
+ val deCompressFileName = normalizedPathName(enhanceDir)
return filePartFile.deCompress(deCompressFileName)
}
diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
index 74f225a5b..62a37bef1 100644
--- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
+++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt
@@ -23,16 +23,16 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.apps.controllerblueprints.TestApplication
+import org.onap.ccsdk.apps.controllerblueprints.core.deleteDir
import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintEnhancerService
import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService
+import org.onap.ccsdk.apps.controllerblueprints.core.normalizedPathName
import org.onap.ccsdk.apps.controllerblueprints.service.load.ModelTypeLoadService
import org.onap.ccsdk.apps.controllerblueprints.service.load.ResourceDictionaryLoadService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.TestPropertySource
import org.springframework.test.context.junit4.SpringRunner
-import java.io.File
-import java.nio.file.Paths
@RunWith(SpringRunner::class)
@ContextConfiguration(classes = arrayOf(TestApplication::class))
@@ -92,9 +92,9 @@ class BluePrintEnhancerServiceImplTest {
private fun testComponentInvokeEnhancementAndValidation(basePath: String, targetDirName: String) {
runBlocking {
- val targetPath = Paths.get("target", targetDirName).toUri().path
+ val targetPath = normalizedPathName("target/blueprints/enrichment", targetDirName)
- deleteTargetDirectory(targetPath)
+ deleteDir(targetPath)
val bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath)
Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext)
@@ -102,12 +102,10 @@ class BluePrintEnhancerServiceImplTest {
// Validate the Generated BluePrints
val valid = bluePrintValidatorService.validateBluePrints(targetPath)
Assert.assertTrue("blueprint($basePath) validation failed ", valid)
+
+ deleteDir(targetPath)
}
}
- private fun deleteTargetDirectory(targetPath: String) {
- val targetDirectory = File(targetPath)
- targetDirectory.deleteRecursively()
- }
} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt
index 026561e10..6bd10525e 100644
--- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt
+++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt
@@ -31,7 +31,7 @@ class BluePrintEnhancerUtilsTest {
private val blueprintDir = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
private val blueprintArchivePath: String = "./target/blueprints/archive"
private val blueprintEnrichmentPath: String = "./target/blueprints/enrichment"
- private var zipBlueprintFileName = Paths.get(blueprintArchivePath, "test.zip").normalize().toUri().path
+ private var zipBlueprintFileName = normalizedPathName(blueprintArchivePath, "test.zip")
@Before
fun setUp() {