mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-15 07:03:49 +08:00
Spring Boot 入门、Spring Boot 配置、Web 开发、模板引擎、数据存储、数据缓存 案例更新
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package demo.springboot;
|
||||
|
||||
import demo.springboot.config.BookComponent;
|
||||
import demo.springboot.config.BookProperties;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class ConfigApplicationTests {
|
||||
|
||||
@Autowired
|
||||
BookProperties bookProperties;
|
||||
|
||||
@Autowired
|
||||
BookComponent bookComponent;
|
||||
|
||||
@Test
|
||||
public void testBookProperties() {
|
||||
Assert.assertEquals(bookProperties.getName(),"[Spring Boot 2.x Core Action]");
|
||||
Assert.assertEquals(bookProperties.getWriter(),"BYSocket");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBookComponent() {
|
||||
Assert.assertEquals(bookComponent.getName(),"[Spring Boot 2.x Core Action]");
|
||||
Assert.assertEquals(bookComponent.getWriter(),"BYSocket");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user