对HelloWorld做一些修改,使其有反馈结果
public class HelloWorld {
public static void main(String[] args){
System.out.println(helloWorld());
}
public static String helloWorld() {
return "Hello World!";
}
}
Junit单元检测
import static org.junit.Assert;
import org.junit.Test;
public class TestHelloWorld {
@Test public void TestHello() {
String result = HelloWorld.helloWorld();
Assert.assertEquals("Hello World!", result);
}
}