forked from chenjiangtao/veryjava.spring.boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentServiceTest.java
More file actions
50 lines (41 loc) · 1013 Bytes
/
Copy pathStudentServiceTest.java
File metadata and controls
50 lines (41 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package cn.veryjava;
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;
import static org.junit.Assert.*;
/**
* 描述: TODO:
* 包名: cn.veryjava.
* 作者: barton.
* 日期: 16-10-13.
* 项目名称: veryjava.spring.boot
* 版本: 1.0
* JDK: since 1.8
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = JdbcApplication.class)
public class StudentServiceTest {
@Autowired
private StudentService service;
@Test
public void select() throws Exception {
service.select().forEach(student -> System.out.println(student));
}
@Test
public void add() throws Exception {
service.add();
select();
}
@Test
public void update() throws Exception {
service.update();
select();
}
@Test
public void delete() throws Exception {
service.delete();
select();
}
}