問題描述:
1. assertThat()紅色報警
2. is()紅色報警
問題解決:
1. 導入 import static org.hamcrest.MatcherAssert.assertThat;
注意: 不要導入org.junit.Assert.assertThat, 因為這個包里的assertThat()已經Deprecated, 需要use org.hamcrest.MatcherAssert.assertThat()
2. 導入 import static org.hamcrest.CoreMatchers.is;
或者 import static org.hamcrest.core.Is.is;
導入過程:
1.------------------------------------------------------------------------
2.---------------------------------------------------------------------------------