执行mvn test 测试命令, HelloWorldTest文件中只要有!号,不管是不是中英文的感叹号,都报错!
Results :
Failed tests: testHello(com.imooc.maven01.model.HelloWorldTest): expected:<Hello World[!]> but was:<Hello World[]>
Results :
Failed tests: testHello(com.imooc.maven01.model.HelloWorldTest): expected:<Hello World[!]> but was:<Hello World[]>
2017-09-10
package com.imooc.maven01.model; import org.junit.*; import org.junit.Assert.*; public class HelloWorldTest{ @Test public void testHello(){ Assert.assertEquals("Hello World!",new HelloWorld().sayHello()); } }
package com.imooc.maven01.model;
public class HelloWorld{
public String sayHello(){
return "Hello World!";
}
}
希望可以帮到你 !
举报