CORDA-2345: Removed TestCordapp.scanPackage to allow in future different ways of finding CorDapps other can package scanning (#4508)

This commit is contained in:
Shams Asari 2019-01-08 09:50:45 +00:00 committed by GitHub
parent 57a70fa1e8
commit 6d2f8fee5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -9,6 +9,9 @@ import net.corda.testing.node.internal.TestCordappImpl
* Encapsulates a CorDapp that exists on the current classpath, which can be pulled in for testing. Use [TestCordapp.findCordapp]
* to locate an existing CorDapp.
*
* This is a replacement API to [DriverParameters.extraCordappPackagesToScan] and [MockNetwork.cordappPackages] as they create custom jars
* which do not preserve any CorDapp metadata.
*
* @see DriverParameters.cordappsForAllNodes
* @see NodeParameters.additionalCordapps
* @see MockNetworkParameters.cordappsForAllNodes
@ -16,9 +19,6 @@ import net.corda.testing.node.internal.TestCordappImpl
*/
@DoNotImplement
abstract class TestCordapp {
/** The package used to find the CorDapp. This may not be the root package of the CorDapp. */
abstract val scanPackage: String
/** Returns the config for on this CorDapp, defaults to empty if not specified. */
abstract val config: Map<String, Any>

View File

@ -39,8 +39,6 @@ data class CustomCordapp(
override val jarFile: Path get() = getJarFile(this)
override val scanPackage: String get() = throw UnsupportedOperationException()
override fun withConfig(config: Map<String, Any>): CustomCordapp = copy(config = config)
override fun withOnlyJarContents(): CustomCordapp = CustomCordapp(packages = packages, classes = classes)

View File

@ -18,7 +18,7 @@ import kotlin.streams.toList
* the [scanPackage] may reference a gradle CorDapp project on the local system. In this scenerio the project's "jar" task is executed to
* build the CorDapp jar. This allows us to inherit the CorDapp's MANIFEST information without having to do any extra processing.
*/
data class TestCordappImpl(override val scanPackage: String, override val config: Map<String, Any>) : TestCordappInternal() {
data class TestCordappImpl(val scanPackage: String, override val config: Map<String, Any>) : TestCordappInternal() {
override fun withConfig(config: Map<String, Any>): TestCordappImpl = copy(config = config)
override fun withOnlyJarContents(): TestCordappImpl = copy(config = emptyMap())