【发布时间】:2017-09-24 14:51:44
【问题描述】:
不推荐使用org.hamcrest.CoreMatchers.is() 方法。
doc 说使用 - org.hamcrest.CoreMatchers.isA() 代替。
但isA() 似乎一起服务于不同的情况。
好的。无论如何,来解决我的问题。早些时候我使用is() 如下
// might be i should not be using it like this, but it works.
assertThat(actualRes, is(true));
现在我不能将它与isA() 一起使用。它抛出编译错误
不适用于参数(布尔值)
我了解isA() 的作用。我想知道的是,鉴于is() 已被弃用,我应该用什么来代替assertThat(actualRes, is(true))?
【问题讨论】:
标签: java junit junit4 hamcrest