Skip to content

Commit

Permalink
Merge branch 'release/os/5.1' of https://github.com/corda/corda-api i…
Browse files Browse the repository at this point in the history
…nto nandor/CORE-14025/find-existing-tx-backchain
  • Loading branch information
nkovacsx committed Oct 5, 2023
2 parents d4c3d52 + 4f8bdaf commit 23d67ec
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"name": "actor",
"type": "string",
"doc": "ID of RPC user that requested the virtual node creation."
},
{
"name": "forceUpgrade",
"type": "boolean",
"doc": "Whether this upgrade should be forced regardless of OperationInProgress.",
"default": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package net.corda.data.virtualnode

import org.apache.avro.Schema
import org.apache.avro.SchemaCompatibility
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

class VirtualNodeUpgradeRequestSchemaCompatibilityTest {

@Test
fun `VirtualNodeUpgradeRequest schema changes between Corda 5_0 and 5_1 are compatible`() {
val schemaV50Json = """
{
"type": "record",
"name": "VirtualNodeUpgradeRequest",
"namespace": "net.corda.data.virtualnode",
"fields": [
{
"name": "virtualNodeShortHash",
"type": "string",
"doc": "Short hash of the virtual node / holding identity."
},
{
"name": "cpiFileChecksum",
"type": "string",
"doc": "The checksum of the CPI file."
},
{
"name": "actor",
"type": "string",
"doc": "ID of RPC user that requested the virtual node creation."
}
]
}
""".trimIndent()

val schemaV50 = Schema.Parser().parse(schemaV50Json)
val schemaV51 = VirtualNodeUpgradeRequest.`SCHEMA$`

val compatibility = SchemaCompatibility.checkReaderWriterCompatibility(schemaV51, schemaV50)
Assertions.assertEquals(
compatibility.type,
SchemaCompatibility.SchemaCompatibilityType.COMPATIBLE,
"Failed due to incompatible change. ${compatibility.description}"
)
}
}

0 comments on commit 23d67ec

Please sign in to comment.