Making sure non-serialisable objects in FlowException do not interfere with the flow session (#651)

Also TransactionVerificationException no longer has reference to non-serialisable LedgerTransaction
This commit is contained in:
Shams Asari
2017-05-09 17:01:13 +01:00
parent 9d19473578
commit e75732af91
8 changed files with 70 additions and 53 deletions

View File

@ -1,7 +1,6 @@
package net.corda.client.rpc
import net.corda.core.contracts.DOLLARS
import net.corda.core.flows.FlowException
import net.corda.core.flows.FlowInitiator
import net.corda.core.getOrThrow
import net.corda.core.messaging.*
@ -9,6 +8,7 @@ import net.corda.core.node.services.ServiceInfo
import net.corda.core.random63BitValue
import net.corda.core.serialization.OpaqueBytes
import net.corda.core.utilities.ALICE
import net.corda.flows.CashException
import net.corda.flows.CashIssueFlow
import net.corda.flows.CashPaymentFlow
import net.corda.node.internal.Node
@ -86,11 +86,10 @@ class CordaRPCClientTest : NodeBasedTest() {
}
@Test
fun `FlowException thrown by flow`() {
fun `sub-type of FlowException thrown by flow`() {
login(rpcUser.username, rpcUser.password)
val handle = connection!!.proxy.startFlow(::CashPaymentFlow, 100.DOLLARS, node.info.legalIdentity)
// TODO Restrict this to CashException once RPC serialisation has been fixed
assertThatExceptionOfType(FlowException::class.java).isThrownBy {
assertThatExceptionOfType(CashException::class.java).isThrownBy {
handle.returnValue.getOrThrow()
}
}