mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-14 06:03:52 +08:00
first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package org.spring.springboot;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* Spring Boot应用启动类
|
||||
*
|
||||
* Created by bysocket on 16/4/26.
|
||||
*/
|
||||
// Spring Boot 应用的标识
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 程序启动入口
|
||||
// 启动嵌入式的Tomcat并初始化Spring环境及其各Spring组件
|
||||
SpringApplication.run(Application.class,args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.spring.springboot.web;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Spring Boot HelloWorldController 测试 - {@link HelloWorldController}
|
||||
*
|
||||
* Created by bysocket on 16/4/26.
|
||||
*/
|
||||
public class HelloWorldControllerTest {
|
||||
|
||||
@Test
|
||||
public void testSayHello() {
|
||||
assertEquals("Hello,World!",new HelloWorldController().sayHello());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user