CORDA-3028: Add Node Diagnostics Info RPC Call - Backport a diff from… (#5287)

* CORDA-3028: Add Node Diagnostics Info RPC Call - Backport a diff from Corda ENT

* CORDA-3028: Add Node Diagnostics Info RPC Call - Rename a value for consistency

* CORDA-3028: Add Node Diagnostics Info RPC Call - One more change
This commit is contained in:
gwr3com 2019-07-10 11:31:44 +01:00 committed by Anthony Keenan
parent 687fa81894
commit 22e4b8e962

View File

@ -11,7 +11,7 @@ import kotlin.test.assertTrue
class NodeRPCTests {
private val CORDA_VERSION_REGEX = "\\d+(\\.\\d+)?(-\\w+)?".toRegex() // e.g. "5.0-SNAPSHOT"
private val CORDA_VENDOR = "Corda Open Source"
private val CORDA_VENDOR_REGEX = "Corda (Open Source|Enterprise Edition)".toRegex()
private val CORDAPPS = listOf(FINANCE_CONTRACTS_CORDAPP, FINANCE_WORKFLOWS_CORDAPP)
private val CORDAPP_TYPES = setOf("Contract CorDapp", "Workflow CorDapp")
private val CORDAPP_CONTRACTS_NAME_REGEX = "corda-finance-contracts-$CORDA_VERSION_REGEX".toRegex()
@ -23,12 +23,12 @@ class NodeRPCTests {
@Test
fun `run nodeDiagnosticInfo`() {
driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = CORDAPPS)) {
driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = CORDAPPS, extraCordappPackagesToScan = emptyList())) {
val nodeDiagnosticInfo = startNode().get().rpc.nodeDiagnosticInfo()
assertTrue(nodeDiagnosticInfo.version.matches(CORDA_VERSION_REGEX))
assertTrue(nodeDiagnosticInfo.revision.matches(HEXADECIMAL_REGEX))
assertEquals(PLATFORM_VERSION, nodeDiagnosticInfo.platformVersion)
assertEquals(CORDA_VENDOR, nodeDiagnosticInfo.vendor)
assertTrue(nodeDiagnosticInfo.vendor.matches(CORDA_VENDOR_REGEX))
assertEquals(CORDAPPS.size, nodeDiagnosticInfo.cordapps.size)
assertEquals(CORDAPP_TYPES, nodeDiagnosticInfo.cordapps.map { it.type }.toSet())
assertTrue(nodeDiagnosticInfo.cordapps.any { it.name.matches(CORDAPP_CONTRACTS_NAME_REGEX) })