mirror of
https://github.com/corda/corda.git
synced 2025-02-20 09:26:41 +00:00
CORDA-2345: Removed TestCordapp.scanPackage to allow in future different ways of finding CorDapps other can package scanning (#4508)
This commit is contained in:
parent
57a70fa1e8
commit
6d2f8fee5f
@ -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>
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user