我们如何使用Mockito模拟科特林编写的Corda中的强制转换状态?

问题描述

signedTx.tx.outputStates.last()作为myState--这是我的要求。我必须对此进行模拟,其中signedTx.tx.outputStates.last()返回ContractState,而myState是我的自定义状态。

val响应= JSONObject() val owner = proxy.nodeInfo()。legalIdentities.first()
        val signedTx = proxy.startFlowDynamic(myFlow.myFlowInitiator::class.java,Data,status,subStatus,owner
        ).returnValue.getOrThrow()

        val outputState=signedTx.tx.outputStates.last() as myState
       
        if( myState.action.equals("submit",false)){
            response["Response"] = "Success"
            response["message"] = "All goood"
            response["TxnId"] = signedTx.id.toString()
            response["Id"] = outputState.id
            ResponseEntity.status(HttpStatus.CREATED).body(response)

        }`

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)