File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed
src/test/java/de/rieckpil/courses Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 6
6
import org .junit .jupiter .api .Test ;
7
7
import org .springframework .beans .factory .annotation .Autowired ;
8
8
import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
9
- import org .springframework .boot .test .mock .mockito .MockBean ;
9
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
10
10
import org .springframework .context .annotation .Import ;
11
11
import org .springframework .http .HttpHeaders ;
12
12
import org .springframework .http .MediaType ;
25
25
@ Import (WebSecurityConfig .class )
26
26
class BookControllerTest {
27
27
28
- @ MockBean private BookManagementService bookManagementService ;
28
+ @ MockitoBean private BookManagementService bookManagementService ;
29
29
30
30
@ Autowired private MockMvc mockMvc ;
31
31
Original file line number Diff line number Diff line change 11
11
import org .slf4j .Logger ;
12
12
import org .slf4j .LoggerFactory ;
13
13
import org .springframework .beans .factory .annotation .Autowired ;
14
- import org .springframework .boot .test .mock .mockito .MockBean ;
14
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
15
15
import org .springframework .test .context .DynamicPropertyRegistry ;
16
16
import org .springframework .test .context .DynamicPropertySource ;
17
17
import org .testcontainers .containers .localstack .LocalStackContainer ;
@@ -59,9 +59,9 @@ static void configureProperties(DynamicPropertyRegistry registry) {
59
59
60
60
@ Autowired private SqsTemplate sqsTemplate ;
61
61
62
- @ MockBean private BookRepository bookRepository ;
62
+ @ MockitoBean private BookRepository bookRepository ;
63
63
64
- @ MockBean private OpenLibraryApiClient openLibraryApiClient ;
64
+ @ MockitoBean private OpenLibraryApiClient openLibraryApiClient ;
65
65
66
66
@ Test
67
67
void shouldConsumeMessageWhenPayloadIsCorrect () {
Original file line number Diff line number Diff line change 17
17
import org .springframework .beans .factory .annotation .Autowired ;
18
18
import org .springframework .boot .autoconfigure .ImportAutoConfiguration ;
19
19
import org .springframework .boot .autoconfigure .jackson .JacksonAutoConfiguration ;
20
- import org .springframework .boot .test .mock .mockito .MockBean ;
20
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
21
21
import org .springframework .context .annotation .Import ;
22
22
import org .springframework .test .context .DynamicPropertyRegistry ;
23
23
import org .springframework .test .context .DynamicPropertySource ;
@@ -79,9 +79,9 @@ static void configureProperties(DynamicPropertyRegistry registry) {
79
79
80
80
@ Autowired private SqsTemplate sqsTemplate ;
81
81
82
- @ MockBean private BookRepository bookRepository ;
82
+ @ MockitoBean private BookRepository bookRepository ;
83
83
84
- @ MockBean private OpenLibraryApiClient openLibraryApiClient ;
84
+ @ MockitoBean private OpenLibraryApiClient openLibraryApiClient ;
85
85
86
86
@ Test
87
87
void shouldStartSQS () {
Original file line number Diff line number Diff line change 9
9
import org .junit .jupiter .api .Test ;
10
10
import org .springframework .beans .factory .annotation .Autowired ;
11
11
import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
12
- import org .springframework .boot .test .mock .mockito .MockBean ;
12
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
13
13
import org .springframework .context .annotation .Import ;
14
14
import org .springframework .http .MediaType ;
15
15
import org .springframework .security .test .context .support .WithMockUser ;
27
27
@ Import (WebSecurityConfig .class )
28
28
class ReviewControllerTest {
29
29
30
- @ MockBean private ReviewService reviewService ;
30
+ @ MockitoBean private ReviewService reviewService ;
31
31
32
32
@ Autowired private MockMvc mockMvc ;
33
33
Original file line number Diff line number Diff line change 9
9
import org .junit .jupiter .api .Test ;
10
10
import org .springframework .beans .factory .annotation .Autowired ;
11
11
import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
12
- import org .springframework .boot .test .mock .mockito .MockBean ;
12
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
13
13
import org .springframework .context .annotation .Import ;
14
14
import org .springframework .http .HttpHeaders ;
15
15
import org .springframework .http .MediaType ;
28
28
@ Import (WebSecurityConfig .class )
29
29
class BookControllerOneTest {
30
30
31
- @ MockBean private BookManagementService bookManagementService ;
31
+ @ MockitoBean private BookManagementService bookManagementService ;
32
32
33
33
@ Autowired private MockMvc mockMvc ;
34
34
Original file line number Diff line number Diff line change 9
9
import org .junit .jupiter .api .Test ;
10
10
import org .springframework .beans .factory .annotation .Autowired ;
11
11
import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
12
- import org .springframework .boot .test .mock .mockito .MockBean ;
12
+ import org .springframework .boot .test .mock .mockito .MockitoBean ;
13
13
import org .springframework .context .annotation .Import ;
14
14
import org .springframework .http .HttpHeaders ;
15
15
import org .springframework .http .MediaType ;
31
31
@ DirtiesContext (classMode = DirtiesContext .ClassMode .BEFORE_CLASS )
32
32
class BookControllerTwoTest {
33
33
34
- @ MockBean private BookManagementService bookManagementService ;
34
+ @ MockitoBean private BookManagementService bookManagementService ;
35
35
36
36
@ Autowired private MockMvc mockMvc ;
37
37
You can’t perform that action at this time.
0 commit comments