File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class HttpAspect {
20
20
21
21
private final static Logger LOGGER = LoggerFactory .getLogger (HttpAspect .class );
22
22
23
- @ Pointcut ("execution(public * com.controller.*(..))" )
23
+ @ Pointcut ("execution(public * com.controller.*.* (..))" )
24
24
public void log (){
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ logging:
17
17
spring :
18
18
devtools :
19
19
restart :
20
- additional-paths : Additional paths to watch for changes
20
+ additional-paths : # Additional paths to watch for changes
21
21
datasource :
22
22
one :
23
23
url : jdbc:mysql://localhost:3306/blog
Original file line number Diff line number Diff line change
1
+ package com .controller ;
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 .autoconfigure .web .servlet .AutoConfigureMockMvc ;
7
+ import org .springframework .boot .test .context .SpringBootTest ;
8
+ import org .springframework .test .context .junit4 .SpringRunner ;
9
+ import org .springframework .test .web .servlet .MockMvc ;
10
+ import org .springframework .test .web .servlet .request .MockMvcRequestBuilders ;
11
+ import org .springframework .test .web .servlet .result .MockMvcResultMatchers ;
12
+
13
+ /**
14
+ * Created by zhuzhengping on 2017/3/21.
15
+ */
16
+
17
+ @ RunWith (SpringRunner .class )
18
+ @ SpringBootTest
19
+ @ AutoConfigureMockMvc
20
+ public class AuthorControllerTest {
21
+
22
+ @ Autowired
23
+ private MockMvc mockMvc ;
24
+
25
+ @ Test
26
+ public void getAuthorList () throws Exception {
27
+ mockMvc .perform (MockMvcRequestBuilders .get ("/data/jdbc/author" ))
28
+ .andExpect (MockMvcResultMatchers .status ().isOk ());
29
+ }
30
+
31
+ }
You can’t perform that action at this time.
0 commit comments