且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

声纳抱怨用nullValue的assertThat

更新时间:2023-10-05 14:09:34

我刚刚找到了针对这种情况的解决方案:

I've just found a solution for this case:

此处应使用Hamcrest的MatcherAssert类中的assertThat方法,而不是JUnit的Assert类中的assertThat方法.因此,这里应该在下一次导入时使用

Here should be used assertThat method from Hamcrest's MatcherAssert class instead of JUnit's Assert class. So here should be used next import:

import static org.hamcrest.MatcherAssert.assertThat;

代替:

import static org.junit.Assert.assertThat;