【发布时间】:2015-06-06 18:29:58
【问题描述】:
我遵循了本指南 https://sites.google.com/a/android.com/tools/tech-docs/unit-testing-support 但我被这个错误困住了:
junit.framework.AssertionFailedError: Exception in constructor: testSaveJson (java.lang.RuntimeException: Method put in org.json.JSONObject not mocked. See https://sites.google.com/a/android.com/tools/tech-docs/unit-testing-support for details.
我按照指南所说的那样通过 Gradle 构建进行了修改,但没有任何区别
testOptions {
unitTests.returnDefaultValues = true
}
【问题讨论】:
-
我们需要更多信息。添加一些代码,解释你想要实现的目标。对 JSON(反)序列化程序进行单元测试?
标签: android unit-testing junit