File tree Expand file tree Collapse file tree 5 files changed +7
-12
lines changed
src/test/java/de/rieckpil/courses Expand file tree Collapse file tree 5 files changed +7
-12
lines changed 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 ;
15
14
import org .springframework .test .context .DynamicPropertyRegistry ;
16
15
import org .springframework .test .context .DynamicPropertySource ;
17
16
import org .testcontainers .containers .localstack .LocalStackContainer ;
@@ -59,9 +58,9 @@ static void configureProperties(DynamicPropertyRegistry registry) {
59
58
60
59
@ Autowired private SqsTemplate sqsTemplate ;
61
60
62
- @ MockitoBean private BookRepository bookRepository ;
61
+ @ MockBean private BookRepository bookRepository ;
63
62
64
- @ MockitoBean private OpenLibraryApiClient openLibraryApiClient ;
63
+ @ MockBean private OpenLibraryApiClient openLibraryApiClient ;
65
64
66
65
@ Test
67
66
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 ;
21
20
import org .springframework .context .annotation .Import ;
22
21
import org .springframework .test .context .DynamicPropertyRegistry ;
23
22
import org .springframework .test .context .DynamicPropertySource ;
@@ -79,9 +78,9 @@ static void configureProperties(DynamicPropertyRegistry registry) {
79
78
80
79
@ Autowired private SqsTemplate sqsTemplate ;
81
80
82
- @ MockitoBean private BookRepository bookRepository ;
81
+ @ MockBean private BookRepository bookRepository ;
83
82
84
- @ MockitoBean private OpenLibraryApiClient openLibraryApiClient ;
83
+ @ MockBean private OpenLibraryApiClient openLibraryApiClient ;
85
84
86
85
@ Test
87
86
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 ;
13
12
import org .springframework .context .annotation .Import ;
14
13
import org .springframework .http .MediaType ;
15
14
import org .springframework .security .test .context .support .WithMockUser ;
27
26
@ Import (WebSecurityConfig .class )
28
27
class ReviewControllerTest {
29
28
30
- @ MockitoBean private ReviewService reviewService ;
29
+ @ MockBean private ReviewService reviewService ;
31
30
32
31
@ Autowired private MockMvc mockMvc ;
33
32
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 ;
13
12
import org .springframework .context .annotation .Import ;
14
13
import org .springframework .http .HttpHeaders ;
15
14
import org .springframework .http .MediaType ;
28
27
@ Import (WebSecurityConfig .class )
29
28
class BookControllerOneTest {
30
29
31
- @ MockitoBean private BookManagementService bookManagementService ;
30
+ @ MockBean private BookManagementService bookManagementService ;
32
31
33
32
@ Autowired private MockMvc mockMvc ;
34
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 ;
13
12
import org .springframework .context .annotation .Import ;
14
13
import org .springframework .http .HttpHeaders ;
15
14
import org .springframework .http .MediaType ;
31
30
@ DirtiesContext (classMode = DirtiesContext .ClassMode .BEFORE_CLASS )
32
31
class BookControllerTwoTest {
33
32
34
- @ MockitoBean private BookManagementService bookManagementService ;
33
+ @ MockBean private BookManagementService bookManagementService ;
35
34
36
35
@ Autowired private MockMvc mockMvc ;
37
36
You can’t perform that action at this time.
0 commit comments