代码如下,用的是intelij idea社区版。
import org.junit.Test;
import static org.junit.Assert.assertThat;
import static sun.nio.cs.Surrogate.is;
public class PlayerTest {
public void should_return_3_when_status_is_3(){
Player player = new Player();
assertThat(player.getStatus(),is(3));
}
}
提示错误
`找不到符号
符号: 方法 assertThat(int,boolean)
位置: 类 PlayerTest`
项目的IML文件如下
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>