File tree 7 files changed +14
-14
lines changed
src/test/java/de/rieckpil/courses
7 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 3
3
[ ![ Masterclass] ( https://rieckpil.de/wp-content/uploads/2020/09/testing-spring-boot-applications-masterclass-course-logo.png )] ( https://rieckpil.de/testing-spring-boot-applications-masterclass/ )
4
4
5
5
[ ![ ] ( https://img.shields.io/badge/Spring%20Boot%20Version-3.4.5-orange )] ( /pom.xml )
6
- [ ![ ] ( https://img.shields.io/badge/Java%20Version-17 -orange )] ( /pom.xml )
6
+ [ ![ ] ( https://img.shields.io/badge/Java%20Version-21 -orange )] ( /pom.xml )
7
7
[ ![ ] ( https://img.shields.io/badge/Enroll-Now-orange )] ( https://rieckpil.de/testing-spring-boot-applications-masterclass/ )
8
8
9
9
## 😓 Tired of the Friday Afternoon Dread?
Original file line number Diff line number Diff line change 17
17
<description >Testing Spring Boot Applications Masterclass</description >
18
18
19
19
<properties >
20
- <java .version>17 </java .version>
20
+ <java .version>21 </java .version>
21
21
<node .version>v18.16.0</node .version>
22
22
<spring-cloud-aws .version>3.3.0</spring-cloud-aws .version>
23
23
<testcontainers .version>1.20.6</testcontainers .version>
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