summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-03-22 14:45:06 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-22 14:45:06 +0000
commit49fc96a20d98a32e5bfbf88bf3595d09e419c7bd (patch)
treebb27b3c0f961c31e70dac2e88c1ad3610e15ab07
parent274fda687529f97d343d788a4e9da537cfeaa467 (diff)
parentbf3d8697baf3f6f29a29a5a8ec58294d30143dbc (diff)
Merge "Deleting target directory before BP enhance test"
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt15
1 files changed, 15 insertions, 0 deletions
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 48183f4c..e0ecf039 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
@@ -31,6 +31,7 @@ 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)
@@ -81,11 +82,20 @@ class BluePrintEnhancerServiceImplTest {
testComponentInvokeEnhancementAndValidation(basePath, "golden-enhance")
}
+ @Test
+ @Throws(Exception::class)
+ fun testCapabilityRestconfEnhancementAndValidation() {
+ val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/capability_restconf"
+ testComponentInvokeEnhancementAndValidation(basePath, "capability_restconf-enhance")
+
+ }
private fun testComponentInvokeEnhancementAndValidation(basePath: String, targetDirName: String) {
val targetPath = Paths.get("target", targetDirName).toUri().path
+ deleteTargetDirectory(targetPath)
+
val bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath)
Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext)
@@ -94,4 +104,9 @@ class BluePrintEnhancerServiceImplTest {
Assert.assertTrue("blueprint($basePath) validation failed ", valid)
}
+ private fun deleteTargetDirectory(targetPath: String) {
+ val targetDirectory = File(targetPath)
+ targetDirectory.deleteRecursively()
+ }
+
} \ No newline at end of file