import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
public class TestJunit {
String message = "Hello World";
MessageUtil messageutil = new MessageUtil(message);
public void testPrintMessage()
{
assertEquals(message,messageutil.printMessage());
}
}
报错信息:
The method assertEquals(String, String) is undefined for the type TestJunit。
解决方法:
import static org.junit.Assert.assertArrayEquals;
修改为:
import static org.junit.Assert.*;