File tree Expand file tree Collapse file tree
src/test/java/com/digitalsanctuary/spring/user Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 " Bash(./gradlew:*)" ,
1414 " Bash(curl:*)" ,
1515 " mcp__zen__planner" ,
16- " Bash(git add:*)"
16+ " Bash(git add:*)" ,
17+ " Bash(chmod:*)" ,
18+ " Bash(./fix-mockbean-deprecation.sh:*)"
1719 ],
1820 "deny" : []
1921 }
Original file line number Diff line number Diff line change 1616import org .springframework .beans .factory .annotation .Autowired ;
1717import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
1818import org .springframework .boot .test .context .SpringBootTest ;
19- import org .springframework .boot . test .mock . mockito .MockBean ;
19+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2020import org .springframework .http .MediaType ;
2121import org .springframework .security .test .context .support .WithAnonymousUser ;
2222import org .springframework .security .test .context .support .WithMockUser ;
@@ -73,7 +73,7 @@ class ApiSecurityTest {
7373 @ Autowired
7474 private EntityManager entityManager ;
7575
76- @ MockBean
76+ @ MockitoBean
7777 private MailService mailService ;
7878
7979 private UserDto validUserDto ;
Original file line number Diff line number Diff line change 2525import org .springframework .beans .factory .annotation .Autowired ;
2626import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
2727import org .springframework .boot .test .context .SpringBootTest ;
28- import org .springframework .boot . test .mock . mockito .MockBean ;
28+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2929import org .springframework .http .MediaType ;
3030import org .springframework .test .context .ActiveProfiles ;
3131import org .springframework .test .web .servlet .MockMvc ;
@@ -80,10 +80,10 @@ class PasswordResetApiTest {
8080 @ Autowired
8181 private PasswordResetTokenRepository tokenRepository ;
8282
83- @ MockBean
83+ @ MockitoBean
8484 private MailService mailService ;
8585
86- @ MockBean
86+ @ MockitoBean
8787 private UserEmailService userEmailService ;
8888
8989 @ PersistenceContext
Original file line number Diff line number Diff line change 1616import org .springframework .beans .factory .annotation .Autowired ;
1717import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
1818import org .springframework .boot .test .context .SpringBootTest ;
19- import org .springframework .boot . test .mock . mockito .MockBean ;
19+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2020import org .springframework .http .MediaType ;
2121import org .springframework .test .context .ActiveProfiles ;
2222import org .springframework .test .web .servlet .MockMvc ;
@@ -58,10 +58,10 @@ class PasswordResetApiTestSimplified {
5858 @ Autowired
5959 private UserService userService ;
6060
61- @ MockBean
61+ @ MockitoBean
6262 private MailService mailService ;
6363
64- @ MockBean
64+ @ MockitoBean
6565 private UserEmailService userEmailService ;
6666
6767 @ BeforeEach
Original file line number Diff line number Diff line change 1616import org .springframework .beans .factory .annotation .Autowired ;
1717import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
1818import org .springframework .boot .test .context .SpringBootTest ;
19- import org .springframework .boot . test .mock . mockito .MockBean ;
19+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2020import org .springframework .http .MediaType ;
2121import org .springframework .security .crypto .password .PasswordEncoder ;
2222import org .springframework .test .context .ActiveProfiles ;
@@ -69,7 +69,7 @@ class PasswordResetCompletionTest {
6969 @ Autowired
7070 private PasswordEncoder passwordEncoder ;
7171
72- @ MockBean
72+ @ MockitoBean
7373 private MailService mailService ;
7474
7575 @ PersistenceContext
Original file line number Diff line number Diff line change 1515import org .junit .jupiter .api .Test ;
1616import org .springframework .beans .factory .annotation .Autowired ;
1717import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
18- import org .springframework .boot . test .mock . mockito .MockBean ;
18+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
1919import org .springframework .context .annotation .Import ;
2020import org .springframework .http .MediaType ;
2121import org .springframework .security .test .context .support .WithMockUser ;
@@ -78,7 +78,7 @@ class UserApiIntegrationTest {
7878 @ Autowired
7979 private PasswordResetTokenRepository passwordResetTokenRepository ;
8080
81- @ MockBean
81+ @ MockitoBean
8282 private MailService mailService ;
8383
8484 private Role userRole ;
Original file line number Diff line number Diff line change 1212import org .springframework .beans .factory .annotation .Autowired ;
1313import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
1414import org .springframework .boot .test .context .SpringBootTest ;
15- import org .springframework .boot . test .mock . mockito .MockBean ;
15+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
1616import org .springframework .http .MediaType ;
1717import org .springframework .security .test .context .support .WithMockUser ;
1818import org .springframework .test .context .ActiveProfiles ;
@@ -57,7 +57,7 @@ class UserApiIntegrationTestFixed {
5757 @ Autowired
5858 private UserService userService ;
5959
60- @ MockBean
60+ @ MockitoBean
6161 private MailService mailService ;
6262
6363 @ PersistenceContext
Original file line number Diff line number Diff line change 1212import org .springframework .beans .factory .annotation .Autowired ;
1313import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
1414import org .springframework .boot .test .context .SpringBootTest ;
15- import org .springframework .boot . test .mock . mockito .MockBean ;
15+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
1616import org .springframework .http .MediaType ;
1717import org .springframework .test .context .ActiveProfiles ;
1818import org .springframework .test .web .servlet .MockMvc ;
@@ -44,7 +44,7 @@ class UserApiSimpleTest {
4444 @ Autowired
4545 private UserRepository userRepository ;
4646
47- @ MockBean
47+ @ MockitoBean
4848 private MailService mailService ;
4949
5050 @ Autowired
Original file line number Diff line number Diff line change 2020import org .springframework .beans .factory .annotation .Autowired ;
2121import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
2222import org .springframework .boot .test .context .SpringBootTest ;
23- import org .springframework .boot . test .mock . mockito .MockBean ;
23+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2424import org .springframework .http .MediaType ;
2525import org .springframework .mock .web .MockHttpServletResponse ;
2626import org .springframework .test .context .ActiveProfiles ;
@@ -70,7 +70,7 @@ public class UserApiTest {
7070 @ Autowired
7171 private ObjectMapper objectMapper ;
7272
73- @ MockBean
73+ @ MockitoBean
7474 private com .digitalsanctuary .spring .user .mail .MailService mailService ;
7575
7676 private static final UserDto baseTestUser = ApiTestData .BASE_TEST_USER ;
Original file line number Diff line number Diff line change 1818import org .springframework .beans .factory .annotation .Autowired ;
1919import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
2020import org .springframework .boot .test .context .SpringBootTest ;
21- import org .springframework .boot . test .mock . mockito .MockBean ;
21+ import org .springframework .test .context . bean . override . mockito .MockitoBean ;
2222import org .springframework .http .MediaType ;
2323import org .springframework .test .context .ActiveProfiles ;
2424import org .springframework .test .web .servlet .MockMvc ;
@@ -64,7 +64,7 @@ class UserRegistrationComprehensiveTest {
6464 @ Autowired
6565 private UserService userService ;
6666
67- @ MockBean
67+ @ MockitoBean
6868 private MailService mailService ;
6969
7070 @ BeforeEach
You can’t perform that action at this time.
0 commit comments