import org.junit.Rule
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
+import org.onap.ccsdk.cds.blueprintsprocessor.uat.utils.ExtendedTemporaryFolder
+import org.onap.ccsdk.cds.blueprintsprocessor.uat.utils.UatExecutor
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.UAT_SPECIFICATION_FILE
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils.Companion.compressToBytes
import org.springframework.beans.factory.annotation.Autowired
// 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)
-class BlueprintsAcceptanceTest(@Suppress("unused") private val blueprintName: String, // readable test description
- private val rootFs: FileSystem) : BaseUatTest() {
+class BlueprintsAcceptanceTest(
+ @Suppress("unused") private val blueprintName: String, // readable test description
+ private val rootFs: FileSystem
+) : BaseUatTest() {
companion object {
@Parameterized.Parameters(name = "{index} {0}")
@JvmStatic
fun scanUatEmpoweredBlueprints(): List<Array<Any>> {
- return (File(UAT_BLUEPRINTS_BASE_DIR)
+ return (
+ File(UAT_BLUEPRINTS_BASE_DIR)
.listFiles { file -> file.isDirectory && File(file, UAT_SPECIFICATION_FILE).isFile }
- ?: throw RuntimeException("Failed to scan $UAT_BLUEPRINTS_BASE_DIR"))
- .map { file ->
- arrayOf(
- file.nameWithoutExtension,
- FileSystems.newFileSystem(file.canonicalFile.toPath(), null)
- )
- }
+ ?: throw RuntimeException("Failed to scan $UAT_BLUEPRINTS_BASE_DIR")
+ )
+ .map { file ->
+ arrayOf(
+ file.nameWithoutExtension,
+ FileSystems.newFileSystem(file.canonicalFile.toPath(), null as? ClassLoader)
+ )
+ }
}
}
uatExecutor.execute(uatSpec, cbaBytes)
}
}
-}
\ No newline at end of file
+}