【发布时间】:2019-06-05 16:51:13
【问题描述】:
当我尝试运行我的 Junit 测试(用 Kotlin 编写)时,出现以下异常:
java.lang.IllegalArgumentException: Attempted to find dependent attachment for class javax/xml/bind/DatatypeConverter, but could not find a suitable candidate.
我尝试在以下代码中注释/取消注释某些行,似乎在我调用 command() 时发生异常
IRIssueTests 类 {
class DummyCommand : TypeOnlyCommandData()
private val ledgerServices = MockServices(listOf("com.my.package.name"))
private val ALICE = TestIdentity(CordaX500Name(organisation = "Alice", locality = "TestLand", country = "US"))
@Test
fun mustIncludeIssueCommand() {
val ir = IRState(
UniqueIdentifier(),
mutableListOf(ALICE.party)
)
ledgerServices.ledger {
transaction {
output(IRContract.ID, ir)
command(listOf(ALICE.publicKey), DummyCommand())
fails()
}
transaction {
output(IRContract.ID, ir)
command(listOf(ALICE.publicKey), IRContract.Commands.Issue())
verifies()
}
}
}
}
我想了解我收到此异常的原因以及如何解决它以使我的测试通过
【问题讨论】:
标签: unit-testing kotlin corda