【发布时间】:2018-07-31 11:17:16
【问题描述】:
JUnitTest/Mockito/PowerMockito :: 尝试从 android 中的 res/raw 文件访问 dataSet json 文件,但得到“InvocationTargetException”
InputStream in = this.getClass().getClassLoader().getResourceAsStream("resource.json");
try {
Reader reader = new InputStreamReader(in, "UTF-8");
ConfigModel result = new Gson().fromJson(reader, ConfigModel.class);
} catch (IOException e) {
e.printStackTrace();
}
【问题讨论】:
标签: android mockito powermockito