Skip to content

Commit 496b9f3

Browse files
committed
增加一个标准的单元测试,升级依赖到最新版本
1 parent 75423e3 commit 496b9f3

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ GitHub项目:https://github.com/mybatis-book/book
2121
<dependency>
2222
<groupId>org.mybatis.spring.boot</groupId>
2323
<artifactId>mybatis-spring-boot-starter</artifactId>
24-
<version>1.1.1</version>
24+
<version>1.3.1</version>
2525
</dependency>
2626
<!--mapper-->
2727
<dependency>
2828
<groupId>tk.mybatis</groupId>
2929
<artifactId>mapper-spring-boot-starter</artifactId>
30-
<version>1.1.1</version>
30+
<version>1.1.4</version>
3131
</dependency>
3232
<!--pagehelper-->
3333
<dependency>
3434
<groupId>com.github.pagehelper</groupId>
3535
<artifactId>pagehelper-spring-boot-starter</artifactId>
36-
<version>1.1.1</version>
36+
<version>1.2.1</version>
3737
</dependency>
3838
```
3939
## Spring DevTools 配置

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@
7878
<dependency>
7979
<groupId>org.mybatis.spring.boot</groupId>
8080
<artifactId>mybatis-spring-boot-starter</artifactId>
81-
<version>1.3.0</version>
81+
<version>RELEASE</version>
8282
</dependency>
8383
<!--mapper-->
8484
<dependency>
8585
<groupId>tk.mybatis</groupId>
8686
<artifactId>mapper-spring-boot-starter</artifactId>
87-
<version>1.1.4</version>
87+
<version>RELEASE</version>
8888
</dependency>
8989
<!--pagehelper-->
9090
<dependency>
9191
<groupId>com.github.pagehelper</groupId>
9292
<artifactId>pagehelper-spring-boot-starter</artifactId>
93-
<version>1.1.3</version>
93+
<version>RELEASE</version>
9494
</dependency>
9595

9696
<dependency>
@@ -102,7 +102,7 @@
102102
<dependency>
103103
<groupId>com.alibaba</groupId>
104104
<artifactId>druid-spring-boot-starter</artifactId>
105-
<version>1.1.0</version>
105+
<version>RELEASE</version>
106106
</dependency>
107107

108108
</dependencies>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package tk.mybatis.springboot.test;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.boot.test.context.SpringBootTest;
7+
import org.springframework.context.annotation.Import;
8+
import org.springframework.test.context.junit4.SpringRunner;
9+
import tk.mybatis.springboot.Application;
10+
import tk.mybatis.springboot.model.Country;
11+
import tk.mybatis.springboot.service.CountryService;
12+
13+
import java.util.List;
14+
15+
/**
16+
* @author liuzh
17+
* @since 2017/9/2.
18+
*/
19+
@RunWith(SpringRunner.class)
20+
@SpringBootTest
21+
@Import(Application.class)
22+
public class CountryServiceTest {
23+
24+
@Autowired
25+
private CountryService countryService;
26+
27+
@Test
28+
public void test() {
29+
Country country = new Country();
30+
List<Country> all = countryService.getAll(country);
31+
for (Country c : all) {
32+
System.out.println(c.getCountryname());
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)