mirror of
https://github.com/corda/corda.git
synced 2025-01-02 03:06:45 +00:00
Fix API stability issue
This commit is contained in:
parent
164079e3a2
commit
af44dfa309
@ -104,6 +104,7 @@ data class MockNetworkParameters(
|
|||||||
fun withServicePeerAllocationStrategy(servicePeerAllocationStrategy: InMemoryMessagingNetwork.ServicePeerAllocationStrategy): MockNetworkParameters {
|
fun withServicePeerAllocationStrategy(servicePeerAllocationStrategy: InMemoryMessagingNetwork.ServicePeerAllocationStrategy): MockNetworkParameters {
|
||||||
return copy(servicePeerAllocationStrategy = servicePeerAllocationStrategy)
|
return copy(servicePeerAllocationStrategy = servicePeerAllocationStrategy)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun withNotarySpecs(notarySpecs: List<MockNetworkNotarySpec>): MockNetworkParameters = copy(notarySpecs = notarySpecs)
|
fun withNotarySpecs(notarySpecs: List<MockNetworkNotarySpec>): MockNetworkParameters = copy(notarySpecs = notarySpecs)
|
||||||
fun withCordappsForAllNodes(cordappsForAllNodes: Collection<TestCordapp>): MockNetworkParameters = copy(cordappsForAllNodes = cordappsForAllNodes)
|
fun withCordappsForAllNodes(cordappsForAllNodes: Collection<TestCordapp>): MockNetworkParameters = copy(cordappsForAllNodes = cordappsForAllNodes)
|
||||||
|
|
||||||
@ -125,7 +126,13 @@ data class MockNetworkParameters(
|
|||||||
* @property validating Boolean for whether the notary is validating or non-validating.
|
* @property validating Boolean for whether the notary is validating or non-validating.
|
||||||
* @property className String the optional name of a notary service class to load. If null, a builtin notary is loaded.
|
* @property className String the optional name of a notary service class to load. If null, a builtin notary is loaded.
|
||||||
*/
|
*/
|
||||||
data class MockNetworkNotarySpec @JvmOverloads constructor(val name: CordaX500Name, val validating: Boolean = true, val className: String? = null)
|
data class MockNetworkNotarySpec @JvmOverloads constructor(val name: CordaX500Name, val validating: Boolean = true) {
|
||||||
|
var className: String? = null
|
||||||
|
|
||||||
|
constructor(name: CordaX500Name, validating: Boolean = true, className: String? = null) : this(name, validating) {
|
||||||
|
this.className = className
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** A class that represents an unstarted mock node for testing. */
|
/** A class that represents an unstarted mock node for testing. */
|
||||||
class UnstartedMockNode private constructor(private val node: InternalMockNetwork.MockNode) {
|
class UnstartedMockNode private constructor(private val node: InternalMockNetwork.MockNode) {
|
||||||
|
@ -249,10 +249,10 @@ open class InternalMockNetwork(cordappPackages: List<String> = emptyList(),
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
internal open fun createNotaries(): List<TestStartedNode> {
|
internal open fun createNotaries(): List<TestStartedNode> {
|
||||||
return notarySpecs.map { (name, validating, className) ->
|
return notarySpecs.map { spec ->
|
||||||
createNode(InternalMockNodeParameters(
|
createNode(InternalMockNodeParameters(
|
||||||
legalName = name,
|
legalName = spec.name,
|
||||||
configOverrides = { doReturn(NotaryConfig(validating, className = className)).whenever(it).notary }
|
configOverrides = { doReturn(NotaryConfig(spec.validating, className = spec.className)).whenever(it).notary }
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user