Skip to content

Commit 34965ae

Browse files
committed
fix test case error
1 parent 878492a commit 34965ae

File tree

3 files changed

+42
-32
lines changed

3 files changed

+42
-32
lines changed

src/main/resources/application-dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ logging:
7272

7373
mybatis-plus:
7474
configuration:
75-
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
75+
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
76+
77+
graphql:
78+
servlet:
79+
websocket:
80+
enabled: false

src/main/resources/application.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ management:
6363
export:
6464
prometheus:
6565
enabled: true
66+
67+
graphql:
68+
servlet:
69+
websocket:
70+
enabled: false
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
//package app.controller;
2-
//
3-
//import app.entity.Film;
4-
//import org.junit.jupiter.api.Test;
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.web.servlet.MockMvc;
9-
//
10-
//import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
11-
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
12-
//
13-
//@SpringBootTest
14-
//@AutoConfigureMockMvc
15-
//class MovieApplicationTest {
16-
//
17-
// @Autowired
18-
// private MockMvc mvc;
19-
//
20-
// @Test
21-
// void getFilmListById() throws Exception {
22-
// Film film = Film.builder()
23-
// .id(1L)
24-
// .movieId(1L)
25-
// .build();
26-
//
27-
// mvc.perform(get("/list/".concat(film.getMovieId().toString())))
28-
// .andExpect(status().isOk());
29-
//
30-
// }
31-
//}
1+
package app.controller;
2+
3+
import app.entity.Film;
4+
import org.junit.jupiter.api.Test;
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.web.servlet.MockMvc;
9+
10+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
11+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
12+
13+
@SpringBootTest
14+
@AutoConfigureMockMvc
15+
class MovieApplicationTest {
16+
17+
@Autowired
18+
private MockMvc mvc;
19+
20+
@Test
21+
void getFilmListById() throws Exception {
22+
Film film = Film.builder()
23+
.id(1L)
24+
.movieId(1L)
25+
.build();
26+
27+
mvc.perform(get("/list/".concat(film.getMovieId().toString())))
28+
.andExpect(status().isOk());
29+
30+
}
31+
}

0 commit comments

Comments
 (0)