File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
src/test/java/com/back/domain Expand file tree Collapse file tree 3 files changed +6
-6
lines changed 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 ;
2423import org .springframework .http .MediaType ;
2524import org .springframework .mock .web .MockMultipartFile ;
2625import org .springframework .security .crypto .password .PasswordEncoder ;
2726import org .springframework .test .context .ActiveProfiles ;
27+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
2828import org .springframework .test .web .servlet .MockMvc ;
2929import org .springframework .test .web .servlet .ResultActions ;
3030import org .springframework .transaction .annotation .Transactional ;
@@ -66,7 +66,7 @@ class PostControllerTest {
6666 @ Autowired
6767 private ObjectMapper objectMapper ;
6868
69- @ MockBean
69+ @ MockitoBean
7070 private FileService fileService ;
7171
7272 private String generateAccessToken (User user ) {
Original file line number Diff line number Diff line change 2626import org .junit .jupiter .api .Test ;
2727import org .springframework .beans .factory .annotation .Autowired ;
2828import org .springframework .boot .test .context .SpringBootTest ;
29- import org .springframework .boot .test .mock .mockito .MockBean ;
3029import org .springframework .data .domain .PageRequest ;
3130import org .springframework .data .domain .Pageable ;
3231import org .springframework .data .domain .Sort ;
3332import org .springframework .mock .web .MockMultipartFile ;
3433import org .springframework .test .context .ActiveProfiles ;
34+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
3535import org .springframework .transaction .annotation .Transactional ;
3636
3737import java .util .List ;
@@ -61,7 +61,7 @@ class PostServiceTest {
6161 @ Autowired
6262 private AttachmentMappingRepository attachmentMappingRepository ;
6363
64- @ MockBean
64+ @ MockitoBean
6565 private FileService fileService ;
6666
6767 // ====================== 게시글 생성 테스트 ======================
Original file line number Diff line number Diff line change 2828import org .junit .jupiter .api .Test ;
2929import org .springframework .beans .factory .annotation .Autowired ;
3030import org .springframework .boot .test .context .SpringBootTest ;
31- import org .springframework .boot .test .mock .mockito .MockBean ;
3231import org .springframework .data .domain .PageRequest ;
3332import org .springframework .data .domain .Pageable ;
3433import org .springframework .data .domain .Sort ;
3534import org .springframework .mock .web .MockMultipartFile ;
3635import org .springframework .security .crypto .password .PasswordEncoder ;
3736import org .springframework .test .context .ActiveProfiles ;
37+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
3838import org .springframework .transaction .annotation .Transactional ;
3939import org .springframework .web .multipart .MultipartFile ;
4040
@@ -73,7 +73,7 @@ class AccountServiceTest {
7373 @ Autowired
7474 private PasswordEncoder passwordEncoder ;
7575
76- @ MockBean
76+ @ MockitoBean
7777 private FileService fileService ;
7878
7979 private MultipartFile mockMultipartFile (String filename ) {
You can’t perform that action at this time.
0 commit comments